package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

class zhz {
   public static int a = 10;
   public static int b = 8;
   public static int c = 5;
   public static int d = 16;

   static void a(zif var0) throws Exception {
      zn var1 = var0.ap();
      zbcr var2 = var0.z();
      if (var0.z().getCount() != 0 && a((List)var0.z().i()) != 0) {
         String var3 = c(var0);
         if (!"".equals(var3)) {
            throw new IllegalArgumentException(var3);
         } else {
            zbcr var4 = new zbcr(var0);
            zbcr var5 = new zbcr(var0);
            Iterator var6 = var2.iterator();

            zbcp var7;
            while(var6.hasNext()) {
               var7 = (zbcp)var6.next();
               if (var7.af() == 1) {
                  var4.a(var7);
               } else {
                  var5.a(var7);
               }
            }

            zbcp var52 = var4.c(0);
            var7 = new zbcp(var0, (zbcr)null, 14);
            if (var5.getCount() > 0) {
               var7 = (zbcp)var5.a(0);
            }

            a(var0, var4, var5);
            boolean var8 = a(var52.ag());
            boolean var9 = a(var7.ag());
            boolean var10 = b(var4);
            boolean var11 = b(var5);
            if (a(var0.g(), var10, var11)) {
               if (var8 == var9) {
                  a(var2, var0.e());
                  var0.g().p = var0.e().p;
                  var0.g().a(var0.e().f());
                  var0.g().q = true;
                  var0.e().q = true;
               } else {
                  a(var4, var0.e());
                  a(var5, var0.g());
               }
            } else {
               a(var4, var0.e());
               a(var5, var0.g());
            }

            if (var0.A().a().getCount() > 0) {
               var0.z().b = true;
            }

            if (var0.A().b().getCount() > 0) {
               var0.z().c = true;
            }

            var0.z().a(a(var0.z().a()));
            var0.z().b(a(var0.z().b()));
            var0.z().a(b(var0.z().a()));
            var0.z().b(b(var0.z().b()));
            if (var0.g().q) {
               a(var0.h(), var0.f());
               n(var0);
            }

            e(var0);
            zbui.a(var0.e(), var0.z().c(), var4);
            zbui.a(var0.g(), var0.z().d(), var5);
            zbui.a(var0.e(), var0.E(), var4, var52);
            zbui.a(var0.g(), var0.G(), var5, var7);
            b(var0, var8, var9);
            boolean var12 = zalc.a(var0);
            var0.x().b = var12;
            d(var0);
            com.aspose.cells.b.a.b.zp var13 = new com.aspose.cells.b.a.b.zp(a, a, var0.a() - a * 2, var0.b() - a * 2);
            var0.c = new com.aspose.cells.b.a.b.zp(0, 0, var0.a() - b / 2, var0.b() - b / 2);
            com.aspose.cells.b.a.b.zt var14;
            com.aspose.cells.b.a.b.zs var15;
            if (var0.K().j()) {
               var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.8F, (float)var13.f() * 0.5F);
               var15 = zbtp.a(var1, var0.K(), var14);
               var0.K().e().b.a((var0.a() - var15.b()) / 2);
               var0.K().e().b.b(a);
               var0.K().e().b.a(var15);
               var13.b(var13.d() + var15.c() + b);
               var13.d(var13.f() - (var15.c() + b));
               var0.c.b(var0.c.d() + var15.c() + a);
               var0.c.d(var0.c.f() - (var15.c() + a));
            }

            if (var0.v()) {
               if (var5.getCount() == 0 && (var52.ag() == 44 || var52.ag() == 35 || var12)) {
                  zbcp var54 = var52;
                  if (var52.m() == 35 || var52.m() == 36) {
                     for(int var55 = 1; var55 < var0.z().getCount(); ++var55) {
                        if (var0.z().a(var55).k() != null && var54.D() != null && var0.z().a(var55).k().getCount() > var54.D().getCount()) {
                           var54 = var0.z().c(var55);
                        }
                     }
                  }

                  com.aspose.cells.b.a.b.zp[] var56;
                  if ((var52.ag() != 35 || var52.H() || var4.getCount() <= 1) && !h(var0)) {
                     a(var0, var54);
                     var56 = new com.aspose.cells.b.a.b.zp[]{var13};
                     zalc.a(var1, var0.x(), var54, var56);
                     var13 = var56[0];
                  } else {
                     g(var0);
                     var56 = new com.aspose.cells.b.a.b.zp[]{var13};
                     zalc.a(var1, var0.x(), var56);
                     var13 = var56[0];
                  }
               } else {
                  g(var0);
                  com.aspose.cells.b.a.b.zp[] var53 = new com.aspose.cells.b.a.b.zp[]{var13};
                  zalc.a(var1, var0.x(), var53);
                  var13 = var53[0];
               }
            }

            com.aspose.cells.b.a.b.zp[] var16;
            if (var0.e().K().j()) {
               b(var0.e(), var8);
               new com.aspose.cells.b.a.b.zt();
               if (var8) {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
               } else {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
               }

               var15 = zbtp.a(var1, var0.e().K(), var14);
               if (var0.E().m() == 1 && !var0.E().p()) {
                  var0.e().n = false;
               } else if (var0.E().m() != 1 && var0.E().p()) {
                  var0.e().n = false;
               }

               var16 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.e(), var16, var8, var15);
               var13 = var16[0];
            }

            if (var0.E().K().j()) {
               b(var0.E(), var8);
               new com.aspose.cells.b.a.b.zt();
               if (!var8) {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
               } else {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
               }

               var15 = zbtp.a(var1, var0.E().K(), var14);
               if (var0.e().m() == 1 && !var0.e().p()) {
                  var0.E().n = false;
               } else if (var0.e().m() != 1 && var0.e().p()) {
                  var0.E().n = false;
               }

               var16 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.E(), var16, var8, var15);
               var13 = var16[0];
            }

            if (var0.g().K().j() && var5.getCount() > 0) {
               b(var0.g(), var9);
               new com.aspose.cells.b.a.b.zt();
               if (var9) {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
               } else {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
               }

               var15 = zbtp.a(var1, var0.g().K(), var14);
               if (var8 == var9) {
                  var0.g().n = !var0.e().n;
               } else {
                  var0.g().n = !var0.E().n;
               }

               var16 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.g(), var16, var9, var15);
               var13 = var16[0];
            }

            if (var0.G().K().j() && var5.getCount() > 0) {
               b(var0.G(), var9);
               new com.aspose.cells.b.a.b.zt();
               if (!var9) {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
               } else {
                  var14 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
               }

               var15 = zbtp.a(var1, var0.G().K(), var14);
               if (var8 == var9) {
                  var0.G().n = !var0.E().n;
               } else {
                  var0.G().n = !var0.e().n;
               }

               var16 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0.G(), var16, var9, var15);
               var13 = var16[0];
            }

            if (!var0.B().s()) {
               var0.a(var0.B().p());
               var0.b = var0.B().p();
               if (var0.B().p().d() < 0) {
                  var0.B().b(var0.B().m() + var0.B().p().d());
                  var0.B().d(0);
               }

               if (var0.B().p().c() < 0) {
                  var0.B().a(var0.B().l() + var0.B().p().c());
                  var0.B().c(0);
               }

               if (var0.B().l() + var0.B().n() > 4000) {
                  var0.B().a(4000 - var0.B().n());
               }

               if (var0.B().m() + var0.B().o() > 4000) {
                  var0.B().b(4000 - var0.B().o());
               }

               var13.a(var0.B().w());
               var13.b(var0.B().x());
               var13.c(var0.B().u());
               var13.d(var0.B().v());
               var13.a(var13.c() + c);
               var13.b(var13.d() + c);
               if (a(var0, var13)) {
                  var13.d(var13.f() - c);
               }

               if (var13.i() + c > var0.a()) {
                  var13.c(var0.a() - c - var13.c());
               }

               if (var13.j() + c > var0.b()) {
                  var13.d(var0.b() - c - var13.d());
               }

               if (var0.e().K().j()) {
                  a(var0.e(), var13, var8);
               }

               if (var0.g().K().j() && var5.getCount() > 0) {
                  a(var0.g(), var13, var9);
               }

               if (var0.E().K().j()) {
                  a(var0.E(), var13, var8);
               }

               if (var0.G().K().j() && var5.getCount() > 0) {
                  a(var0.G(), var13, var9);
               }
            } else {
               var0.a(new com.aspose.cells.b.a.b.zp(var13.c() - c, var13.d() - c, zbuk.c((double)var13.e()), zbuk.c((double)var13.f())));
            }

            com.aspose.cells.b.a.b.zp var60 = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            var0.B().b = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            boolean var59 = false;
            boolean var57 = a(var0.e()) || g(var0.M());
            int var18;
            if (var0.u()) {
               f(var0);
               if (!var8 && !var9 && var0.f().k() != 2 && var0.h().k() != 2) {
                  var0.e().m = 0;
                  var0.f().f(2);
                  var0.f().h(2);
                  var0.g().m = 0;
                  var0.h().f(2);
                  var0.h().h(2);
                  var59 = true;
               }

               com.aspose.cells.b.a.b.zs var17 = zir.a(var1, var0.k(), var13);
               var0.k().a(var17);
               var18 = zir.b(var1, var0.k(), var13);
               var0.k().a(var18);
               int var19 = var17.c() + var18;
               var13.a(var13.c() + var17.b());
               var13.c(var13.e() - var17.b());
               var13.d(var13.f() - var19);
               if (var57) {
                  var0.k().a.a(var13.c());
                  var0.k().a.b(var13.j());
                  var0.k().a.c(var13.e());
                  var13.d(var13.f() - b);
               }
            }

            int var58 = a((List)var4.i());
            var18 = a((List)var5.i());
            double var61 = 0.0D;
            double var21 = 0.0D;
            boolean var23 = false;
            double[] var25;
            boolean var30;
            if (a((zif)var0, (List)var4.i(), (List)var5.i())) {
               zbo var24 = j(var0);
               var25 = new double[]{var61};
               double[] var26 = new double[]{var21};
               var23 = a(var4.i(), var5.i(), var25, var26, var24);
               var61 = var25[0];
               var21 = var26[0];
               var0.f = var61;
               var0.g = var21;
               var0.d = true;
               var0.e = var24;
            } else {
               double[] var62 = new double[]{var61};
               var25 = new double[]{var21};
               var23 = a((List)var4.i(), (double[])var62, (double[])var25, (zbo)var0.E());
               var61 = var62[0];
               var21 = var25[0];
               if (var8 && var0.g().r) {
                  double var63 = 0.0D;
                  double var28 = 0.0D;
                  var30 = false;
                  double[] var31 = new double[]{var63};
                  double[] var32 = new double[]{var28};
                  var30 = b((List)var5.i(), var31, var32, var0.g());
                  var63 = var31[0];
                  var28 = var32[0];
                  if (var63 < var61) {
                     var61 = var63;
                  }

                  if (var28 > var21) {
                     var21 = var28;
                  }

                  if (var23 && !var30) {
                     var23 = false;
                  }

                  var0.g().s = true;
               }
            }

            boolean var64 = var0.E().O();
            boolean var29 = var0.E().P();
            var30 = var0.E().N();
            boolean var65 = var0.E().M();
            boolean var38;
            if (var0.d) {
               if (var0.e == var0.E()) {
                  a(var1, var0.E(), var21, var61, var23, var0.E().l, var52.ag(), var13, var8, var4.c(0));
               } else {
                  a(var1, var0.G(), var21, var61, var23, var0.G().l, var7.ag(), var13, var9, var5.c(0));
               }

               if (var52.at() && var7.at()) {
                  double var66 = 0.0D;
                  double var34 = 0.0D;
                  double[] var36 = new double[]{var66};
                  double[] var37 = new double[]{var34};
                  var38 = a((List)var4.i(), (double[])var36, (double[])var37, (zbo)var0.E());
                  var66 = var36[0];
                  var34 = var37[0];
                  a(var1, var0.E(), var34, var66, var38, var0.E().l, var52.ag(), var13, var8, var4.c(0));
                  var36[0] = var66;
                  var37[0] = var34;
                  var38 = a((List)var5.i(), (double[])var36, (double[])var37, (zbo)var0.G());
                  var66 = var36[0];
                  var34 = var37[0];
                  a(var1, var0.G(), var34, var66, var38, var0.G().l, var7.ag(), var13, var9, var5.c(0));
                  d(var0.E());
                  d(var0.G());
               }

               zbo var67 = k(var0);
               a(var67, var0.e);
            } else if (var52.ag() != 44 && var52.ag() != 35) {
               a(var1, var0.E(), var21, var61, var23, var0.E().l, var52.ag(), var13, var8, var4.c(0));
            }

            boolean var68 = var0.e().O();
            boolean var33 = var0.e().P();
            boolean var69 = var0.e().N();
            boolean var35 = var0.e().M();
            new zbcr(var0);
            if (var0.e().q) {
               a(var1, var0.e(), var0.e().l, var13, var52.ag(), var2, var8);
            } else {
               a(var1, var0.e(), var0.e().l, var13, var52.ag(), var4, var8);
            }

            com.aspose.cells.b.a.b.zs var70 = com.aspose.cells.b.a.b.zs.a();
            com.aspose.cells.b.a.b.zs var40;
            if (!zbuk.a(var13) && var0.E().q() && !var52.at()) {
               a(var0.E(), var0.e(), var4, var0);
               com.aspose.cells.b.a.b.zs var71 = zbq.a(var1, var0.E(), var52, var8);
               var70 = var71;
               c(var0.E(), var8);
               new com.aspose.cells.b.a.b.zt();
               com.aspose.cells.b.a.b.zt var39;
               if (!var8) {
                  var39 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
               } else {
                  var39 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
               }

               var40 = zbtp.a(var0, var0.E().Q(), var39, var60);
               com.aspose.cells.b.a.b.zp[] var41 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var0, var1, var0.E(), var71, var40, var41, var8);
               var13 = var41[0];
            }

            int var77;
            if (!zbuk.a(var13) && !var59 && var0.e().q() && !var52.at()) {
               a(var0.e(), var0.E(), var4, var0);
               var38 = false;
               if (var13.f() <= 15 || var13.f() <= var0.e().G().a().d()) {
                  var38 = true;
               }

               com.aspose.cells.b.a.b.zp var72 = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
               if (var38) {
                  var72.d(var72.f() + 2 * var0.e().G().a().d());
               }

               var40 = zbq.a(var1, var0.e(), var72, var58, var8, var52);
               var77 = (int)((double)(var0.e().F().k() + var0.e().X() + var0.e().Y()) + 0.5D);
               if (var0.z().e() != null) {
                  var77 += var77 * var0.z().e().length;
               }

               if (var52.ag() == 60 || var52.ag() == 12) {
                  c(var0.e(), var8);
                  new com.aspose.cells.b.a.b.zt();
                  com.aspose.cells.b.a.b.zt var42;
                  if (var8) {
                     var42 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
                  } else {
                     var42 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
                  }

                  com.aspose.cells.b.a.b.zs var43 = zbtp.a(var0, var0.e().Q(), var42, var60);
                  var77 += var43.c();
               }

               if (!var38) {
                  com.aspose.cells.b.a.b.zp[] var81 = new com.aspose.cells.b.a.b.zp[]{var13};
                  a(var0, var1, var0.e(), var40, var77, var81, var8);
                  var13 = var81[0];
               }
            }

            com.aspose.cells.b.a.b.zs var95;
            if (var5.getCount() > 0) {
               double var73 = 0.0D;
               double var75 = 0.0D;
               if (var0.d) {
                  var73 = var0.f;
                  var75 = var0.g;
               } else {
                  double[] var82 = new double[]{var73};
                  double[] var83 = new double[]{var75};
                  boolean var44 = a((List)var5.i(), (double[])var82, (double[])var83, (zbo)var0.G());
                  var73 = var82[0];
                  var75 = var83[0];
                  a(var1, var0.G(), var75, var73, var44, var0.G().l, var7.ag(), var13, var9, var5.c(0));
               }

               if (var0.e().q) {
                  var0.g().l = var0.e().l;
                  var0.g().d(var0.e().z());
                  var0.g().f(var0.e().D());
                  var0.g().c(var0.e().x());
                  var0.g().e(var0.e().B());
                  var0.g().d(var0.e().k());
                  if (var0.e().k() == 2) {
                     var0.g().c(var0.e().j());
                     var0.g().g(var0.e().y());
                     var0.g().i(var0.e().C());
                  }
               } else if (var0.g().s) {
                  var0.g().l = var0.E().l;
                  var0.g().d(var0.E().z());
                  var0.g().f(var0.E().D());
                  var0.g().c(var0.E().x());
                  var0.g().e(var0.E().B());
               } else {
                  a(var1, var0.g(), var0.g().l, var13, var7.ag(), var5, var9);
               }

               com.aspose.cells.b.a.b.zs var86;
               if (!zbuk.a(var13) && var0.G().q() && !var7.at()) {
                  a(var0.G(), var0.g(), var5, var0);
                  var86 = zbq.a(var1, var0.G(), var7, var9);
                  c(var0.G(), var9);
                  new com.aspose.cells.b.a.b.zt();
                  com.aspose.cells.b.a.b.zt var87;
                  if (!var9) {
                     var87 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
                  } else {
                     var87 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
                  }

                  com.aspose.cells.b.a.b.zs var90 = zbtp.a(var0, var0.G().Q(), var87, var60);
                  if (var8 == var9) {
                     if (var0.G().m != 3 && var0.G().m == var0.E().m) {
                        var0.G().m = 0;
                     }
                  } else if (var0.G().m != 3 && var0.G().m == var0.e().m) {
                     var0.G().m = 0;
                  }

                  com.aspose.cells.b.a.b.zp[] var45 = new com.aspose.cells.b.a.b.zp[]{var13};
                  a(var0, var1, var0.G(), var86, var90, var45, var9);
                  var13 = var45[0];
               }

               if (!zbuk.a(var13) && !var59 && var0.g().q() && !var7.at()) {
                  a(var0.g(), var0.G(), var5, var0);
                  var86 = zbq.a(var1, var0.g(), var13, var18, var9, var7);
                  int var93 = (int)((double)(var0.g().F().k() + var0.g().X() + var0.g().Y()) + 0.5D);
                  if (var7.ag() == 60 || var7.ag() == 12) {
                     c(var0.e(), var9);
                     new com.aspose.cells.b.a.b.zt();
                     com.aspose.cells.b.a.b.zt var94;
                     if (var9) {
                        var94 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.2F, (float)var13.f() * 0.9F);
                     } else {
                        var94 = new com.aspose.cells.b.a.b.zt((float)var13.e() * 0.9F, (float)var13.f() * 0.2F);
                     }

                     var95 = zbtp.a(var0, var0.e().Q(), var94, var60);
                     var93 += var95.c();
                  }

                  if (var8 == var9) {
                     if (var0.g().m != 3 && var0.g().m == var0.e().m) {
                        var0.g().m = 0;
                     }
                  } else if (var0.g().m != 3 && var0.g().m == var0.E().m) {
                     var0.g().m = 0;
                  }

                  com.aspose.cells.b.a.b.zp[] var99 = new com.aspose.cells.b.a.b.zp[]{var13};
                  a(var0, var1, var0.g(), var86, var93, var99, var9);
                  var13 = var99[0];
               }
            }

            float var74;
            if (!zbuk.a(var13) && var0.E().q() && var0.E().E() != 3 && !var52.at()) {
               var38 = false;
               if (var13.f() <= 15 || var13.f() <= var0.E().G().a().d()) {
                  var38 = true;
               }

               if (!var38) {
                  zbq.b(var1, var0.E(), var52, var8);
                  var74 = var0.E().j;
                  float var78 = var0.E().k;
                  if (!var8) {
                     if ((float)(var13.d() - var60.d()) < var78) {
                        var77 = (int)(var78 - (float)(var13.d() - var60.d()));
                        var13.b(var13.d() + var77);
                        var13.d(var13.f() - var77);
                     }

                     if ((float)(var60.j() - var13.j()) < var74) {
                        var77 = (int)(var74 - (float)(var60.j() - var13.j()));
                        var13.d(var13.f() - var77);
                     }
                  } else {
                     if ((float)(var13.c() - var60.c()) < var74) {
                        var77 = (int)(var74 - (float)(var13.c() - var60.c()));
                        var13.a(var13.c() + var77);
                        var13.c(var13.e() - var77);
                     }

                     if ((float)(var60.i() - var13.i()) < var78) {
                        var77 = (int)(var78 - (float)(var60.i() - var13.i()));
                        var13.c(var13.e() - var77);
                     }
                  }
               }
            }

            float var79;
            int var80;
            if (!zbuk.a(var13) && var0.e().q() && var0.e().E() != 3 && !var52.at() && (var0.e().j > 0.0F || var0.e().k > 0.0F)) {
               var79 = var0.e().j;
               var74 = var0.e().k;
               if (var8) {
                  if ((float)(var13.d() - var60.d()) < var74) {
                     var80 = (int)(var74 - (float)(var13.d() - var60.d()));
                     var13.b(var13.d() + var80);
                     var13.d(var13.f() - var80);
                  }

                  if ((float)(var60.j() - var13.j()) < var79) {
                     var80 = (int)(var79 - (float)(var60.j() - var13.j()));
                     var13.d(var13.f() - var80);
                  }
               } else {
                  if ((float)(var13.c() - var60.c()) < var79) {
                     var80 = (int)(var79 - (float)(var13.c() - var60.c()));
                     var13.a(var13.c() + var80);
                     var13.c(var13.e() - var80);
                  }

                  if ((float)(var60.i() - var13.i()) < var74) {
                     var80 = (int)(var74 - (float)(var60.i() - var13.i()));
                     var13.c(var13.e() - var80);
                  }
               }
            }

            int var76;
            if (var5.getCount() > 0) {
               if (!zbuk.a(var13) && var0.G().q() && var0.G().E() != 3 && !var7.at()) {
                  if (!var9) {
                     var79 = var0.G().g / 2.0F;
                     if ((float)(var13.d() - var60.d()) < var79) {
                        var76 = (int)(var79 - (float)(var13.d() - var60.d()));
                        var13.b(var13.d() + var76);
                        var13.d(var13.f() - var76);
                     }

                     if ((float)(var60.j() - var13.j()) < var79) {
                        var76 = (int)(var79 - (float)(var60.j() - var13.j()));
                        var13.d(var13.f() - var76);
                     }
                  } else {
                     var79 = var0.G().f / 2.0F;
                     if ((float)(var13.c() - var60.c()) < var79) {
                        var76 = (int)(var79 - (float)(var13.c() - var60.c()));
                        var13.a(var13.c() + var76);
                        var13.c(var13.e() - var76);
                     }

                     if ((float)(var60.i() - var13.i()) < var79) {
                        var76 = (int)(var79 - (float)(var60.i() - var13.i()));
                        var13.c(var13.e() - var76);
                     }
                  }
               }

               if (!zbuk.a(var13) && var0.g().q() && var0.g().E() != 3 && !var7.at() && (var0.g().j > 0.0F || var0.g().k > 0.0F)) {
                  if (var9) {
                     var79 = var0.g().g / 2.0F;
                     if ((float)(var13.d() - var60.d()) < var79) {
                        var76 = (int)(var79 - (float)(var13.d() - var60.d()));
                        var13.b(var13.d() + var76);
                        var13.d(var13.f() - var76);
                     }

                     if ((float)(var60.j() - var13.j()) < var79) {
                        var76 = (int)(var79 - (float)(var60.j() - var13.j()));
                        var13.d(var13.f() - var76);
                     }
                  } else {
                     var79 = var0.g().f / 2.0F;
                     if ((float)(var13.c() - var60.c()) < var79) {
                        var76 = (int)(var79 - (float)(var13.c() - var60.c()));
                        var13.a(var13.c() + var76);
                        var13.c(var13.e() - var76);
                     }

                     if ((float)(var60.i() - var13.i()) < var79) {
                        var76 = (int)(var79 - (float)(var60.i() - var13.i()));
                        var13.c(var13.e() - var76);
                     }
                  }
               }
            }

            var0.a(new com.aspose.cells.b.a.b.zq((float)var13.c(), (float)var13.d(), (float)var13.e(), (float)var13.f()));
            if (!zbuk.a(var13)) {
               com.aspose.cells.b.a.b.zp[] var85 = new com.aspose.cells.b.a.b.zp[]{var13};
               a(var1, var0, var52, var7, var85);
               var13 = var85[0];
               if (var0.C().s() && (var0.ai() || var0.aj() || var0.ak())) {
                  var0.a(new com.aspose.cells.b.a.b.zp(var13.c() - c, var13.d() - c, zbuk.c((double)var13.e()), zbuk.c((double)var13.f())));
               }
            }

            zalc.a(var0.x(), var13);
            int var88;
            if (!zbuk.a(var13) && var0.E().q() && !var52.at()) {
               var88 = var0.E().l.size();
               var76 = a(var1, var0.E(), var8, var52, var13);
               boolean var84 = false;
               if (var8) {
                  var80 = var13.e();
               } else {
                  var80 = var13.f();
               }

               boolean var91 = false;
               if (var13.f() <= 15 || var13.f() <= var0.E().G().a().d()) {
                  var91 = true;
               }

               byte var92 = 3;
               if (var91) {
                  var92 = 2;
               }

               if (var64 && var0.E().l.size() > var92 && var76 > var80 && var80 != 0) {
                  double var100 = var0.F().z();
                  var0.E().l.clear();
                  var0.E().i(var64);
                  var0.E().j(var29);
                  var0.E().h(var30);
                  var0.E().g(var65);
                  a(var1, var0.E(), var21, var61, var23, var0.E().l, var52.ag(), var13, var8, var4.c(0));
                  if (var0.E().l.size() != var88) {
                     var95 = zbq.a(var1, var0.E(), var52, var8);
                     com.aspose.cells.b.a.b.zs var46 = new com.aspose.cells.b.a.b.zs(var95.b() - var70.b(), var95.c() - var70.c());
                     com.aspose.cells.b.a.b.zp[] var47 = new com.aspose.cells.b.a.b.zp[]{var13};
                     a(var0, var1, var0.E(), var46, var47, var8);
                     var13 = var47[0];
                  }
               }
            }

            var0.B().b = new com.aspose.cells.b.a.b.zp(var13.c(), var13.d(), var13.e(), var13.f());
            if (var0.e().K().j()) {
               d(var0.e(), var8);
            }

            if (var0.E().K().j()) {
               d(var0.E(), var8);
            }

            if (var0.g().K().j() && var5.getCount() > 0) {
               d(var0.g(), var9);
            }

            if (var0.G().K().j() && var5.getCount() > 0) {
               d(var0.G(), var9);
            }

            if (var0.B().s() && var0.e().q() && var52.ag() == 60) {
               var88 = a(var1, var0.e(), true, var52, var13);
               boolean var89 = false;
               if (var8) {
                  var76 = var13.e();
               } else {
                  var76 = var13.f();
               }

               if (var68 && var0.e().l.size() > 3 && var88 > var76 && var76 != 0) {
                  var0.e().l.clear();
                  var0.e().i(var68);
                  var0.e().j(var33);
                  var0.e().h(var69);
                  var0.e().g(var35);
                  a(var1, var0.e(), var0.e().l, var13, var52.ag(), var4, var8);
               }
            }

            if (!zbuk.a(var13) && var8 && var64) {
               a(var0.E(), var21, var61, var0.M(), (float)var13.e(), var8, var2.c(0), var30, var65, var64);
            }

            if (!zbuk.a(var13) && e(var0.M())) {
               zdt.a(var1, var2, var13, var2.h(), var68, var33, var69, var35, var64, var29, var30, var65);
            }

            var0.B().z();
            var13 = var0.B().a;
            var79 = a(var0.E(), var13.c(), var13.e(), var8);
            double var96 = var0.E().l();
            float var97 = a(var0.G(), var13.c(), var13.e(), var9);
            double var98 = var0.G().l();
            float var101 = a(var0.E(), var13.d(), var13.f(), var8);
            float var102 = a(var0.G(), var13.d(), var13.f(), var9);
            float var103 = a(var0.e(), var13.d(), var13.f(), var8, var4);
            a(var0.g(), var13.d(), var13.f(), var9, var5);
            float var48 = 0.0F;
            float var49 = 0.0F;
            if (var52.ag() != 12 && var52.ag() != 60) {
               var48 = a(var0.e(), var13.c(), var13.e(), var8, var4);
            } else {
               var48 = a(var0.e(), var13.c(), var13.e(), !var8);
            }

            if (var7.ag() != 12 && var7.ag() != 60) {
               a(var0.g(), var13.c(), var13.e(), var9, var5);
            } else {
               var49 = a(var0.g(), var13.c(), var13.e(), !var9);
            }

            com.aspose.cells.b.a.b.zo var50;
            com.aspose.cells.b.a.b.zo var51;
            if (var8) {
               var50 = new com.aspose.cells.b.a.b.zo(var79, (float)var13.d());
               var51 = new com.aspose.cells.b.a.b.zo(var79, (float)var13.j());
               if (var0.e().p()) {
                  var0.e().a(var50);
                  var0.e().b(var51);
               } else {
                  var0.e().a(var51);
                  var0.e().b(var50);
               }
            } else {
               var50 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var101);
               var51 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var101);
               if (!var0.e().p()) {
                  var0.e().a(var50);
                  var0.e().b(var51);
               } else {
                  var0.e().a(var51);
                  var0.e().b(var50);
               }
            }

            if (var9) {
               var50 = new com.aspose.cells.b.a.b.zo(var79, (float)var13.d());
               var51 = new com.aspose.cells.b.a.b.zo(var79, (float)var13.j());
               if (var0.g().p()) {
                  var0.g().a(var50);
                  var0.g().b(var51);
               } else {
                  var0.g().a(var51);
                  var0.g().b(var50);
               }
            } else {
               var50 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var101);
               var51 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var101);
               if (!var0.g().p()) {
                  var0.g().a(var50);
                  var0.g().b(var51);
               } else {
                  var0.g().a(var51);
                  var0.g().b(var50);
               }
            }

            if (var8) {
               var50 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var103);
               var51 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var103);
               if (!var0.E().p()) {
                  var0.E().a(var50);
                  var0.E().b(var51);
               } else {
                  var0.E().a(var51);
                  var0.E().b(var50);
               }
            } else {
               var50 = new com.aspose.cells.b.a.b.zo(var48, (float)var13.d());
               var51 = new com.aspose.cells.b.a.b.zo(var48, (float)var13.j());
               if (var0.E().p()) {
                  var0.E().a(var50);
                  var0.E().b(var51);
               } else {
                  var0.E().a(var51);
                  var0.E().b(var50);
               }
            }

            if (var9) {
               var50 = new com.aspose.cells.b.a.b.zo((float)var13.c(), var103);
               var51 = new com.aspose.cells.b.a.b.zo((float)var13.i(), var103);
               if (!var0.G().p()) {
                  var0.G().a(var50);
                  var0.G().b(var51);
               } else {
                  var0.G().a(var51);
                  var0.G().b(var50);
               }
            } else {
               var50 = new com.aspose.cells.b.a.b.zo(var48, (float)var13.d());
               var51 = new com.aspose.cells.b.a.b.zo(var48, (float)var13.j());
               if (var0.G().p()) {
                  var0.G().a(var50);
                  var0.G().b(var51);
               } else {
                  var0.G().a(var51);
                  var0.G().b(var50);
               }
            }

            i(var0);
            if (var5.getCount() > 0) {
               a(var0, var8, var9);
            }

            var0.h = true;
         }
      }
   }

   static void b(zif var0) throws Exception {
      if (!var0.h) {
         a(var0);
      }

      int var1 = var0.ap().j();
      zbtx.a(var0);
      zn var2 = var0.ap();
      zbcr var3 = var0.z();
      if (var0.z().getCount() != 0 && a((List)var0.z().i()) != 0) {
         zbcr var4 = new zbcr(var0);
         zbcr var5 = new zbcr(var0);
         Iterator var6 = var3.iterator();

         zbcp var7;
         while(var6.hasNext()) {
            var7 = (zbcp)var6.next();
            if (var7.af() == 1) {
               var4.a(var7);
            } else {
               var5.a(var7);
            }
         }

         zbcp var43 = var4.c(0);
         var7 = new zbcp(var0, (zbcr)null, 14);
         if (var5.getCount() > 0) {
            var7 = (zbcp)var5.a(0);
         }

         boolean var8 = a(var43.ag());
         boolean var9 = a(var7.ag());
         int var10 = a((List)var4.i());
         int var11 = a((List)var5.i());
         boolean var12 = var0.B().D();
         if (var43.m() != 44 && var43.m() != 47) {
            ziy.a(var2, var0.B());
         } else {
            var0.B().z();
         }

         com.aspose.cells.b.a.b.zp var13 = var0.B().a;
         float var14 = a(var0.E(), var13.c(), var13.e(), var8);
         double var15 = var0.E().l();
         float var17 = a(var0.G(), var13.c(), var13.e(), var9);
         double var18 = var0.G().l();
         float var20 = a(var0.E(), var13.d(), var13.f(), var8);
         float var21 = a(var0.G(), var13.d(), var13.f(), var9);
         float var22 = a(var0.e(), var13.d(), var13.f(), var8, var4);
         float var23 = a(var0.g(), var13.d(), var13.f(), var9, var5);
         float var24 = 0.0F;
         float var25 = 0.0F;
         if (var43.ag() != 12 && var43.ag() != 60) {
            var24 = a(var0.e(), var13.c(), var13.e(), var8, var4);
         } else {
            var24 = a(var0.e(), var13.c(), var13.e(), !var8);
         }

         if (var7.ag() != 12 && var7.ag() != 60) {
            var25 = a(var0.g(), var13.c(), var13.e(), var9, var5);
         } else {
            var25 = a(var0.g(), var13.c(), var13.e(), !var9);
         }

         if (var43.at()) {
            zbq.a(var2, var0.E(), var13, var10);
         } else {
            zbq.a(var2, var0.e(), var13, var8, var43);
            zbq.a(var2, var0.E(), var13, var8, var43);
         }

         if (var7.at()) {
            zbq.a(var2, var0.G(), var13, var11);
         } else {
            zbq.a(var2, var0.g(), var13, var9, var7);
            zbq.a(var2, var0.G(), var13, var9, var7);
         }

         int var26;
         for(var26 = 0; var26 < var3.getCount(); ++var26) {
            zpt var27 = var3.c(var26).w();
            var27.a().e(var0.B().a.e());
            var27.a().f(var0.B().a.f());

            int var28;
            for(var28 = 0; var28 < var3.a(var26).k().getCount(); ++var28) {
               zpt var29 = var3.c(var26).D().b(var28).o();
               var29.a().e(var0.B().a.e());
               var29.a().f(var0.B().a.f());
            }

            for(var28 = 0; var28 < var3.c(var26).F().getCount(); ++var28) {
               zbtt var47 = var3.c(var26).F().c(var28);
               var47.q().a().e(var0.B().a.e());
               var47.q().a().f(var0.B().a.f());
            }
         }

         boolean var44 = false;
         float var45 = 0.0F;
         float var46 = 0.0F;
         float var48 = 0.0F;
         float var30 = 0.0F;
         double var31 = 0.0D;
         ArrayList var33 = var3.k();
         ArrayList var34 = new ArrayList();
         ArrayList var35 = new ArrayList();
         ArrayList var36 = new ArrayList();
         ArrayList var37 = new ArrayList();
         boolean var38 = false;
         boolean var39 = false;

         int var40;
         zbcp var41;
         for(var40 = 0; var40 < var33.size() && !var12; ++var40) {
            var41 = (zbcp)var33.get(var40);
            if (var41.af() == 1) {
               var26 = var10;
               var45 = var14;
               var31 = var15;
               var46 = var20;
            } else {
               var26 = var11;
               var45 = var17;
               var31 = var18;
               var46 = var21;
            }

            if (var0.d) {
               if (var0.E() == var0.e) {
                  var45 = var14;
                  var31 = var15;
                  var46 = var20;
               } else {
                  var45 = var17;
                  var31 = var18;
                  var46 = var21;
               }
            }

            ArrayList var42;
            if (var41.a(new int[]{14})) {
               var42 = zkq.a(var2, var41, var13, var46, var31, var26);
               com.aspose.cells.b.a.a.ze.a(var34, (Collection)var42);
            } else if (var41.a(new int[]{15})) {
               var42 = zkq.a(var2, var41, var13, var26);
               com.aspose.cells.b.a.a.ze.a(var34, (Collection)var42);
            } else if (var41.a(new int[]{16})) {
               var42 = zkq.b(var2, var41, var13, var26);
               com.aspose.cells.b.a.a.ze.a(var34, (Collection)var42);
            } else if (var41.a(new int[]{37, 40})) {
               var42 = zkq.b(var2, var41, var13, var46, var31, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.a(new int[]{38, 41})) {
               var42 = zkq.a(var2, var41, var13, var46, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.a(new int[]{39, 42})) {
               var42 = zkq.b(var2, var41, var13, var46, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.a(new int[]{6})) {
               var42 = zce.a(var2, var0, var41, var13, var45, var31, var26);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var42);
            } else if (var41.a(new int[]{7})) {
               var42 = zce.a(var2, var0, var41, var13, var26);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var42);
            } else if (var41.a(new int[]{8})) {
               var42 = zce.b(var2, var0, var41, var13, var26);
               com.aspose.cells.b.a.a.ze.a(var36, (Collection)var42);
            } else if (var41.b(new int[]{60})) {
               var42 = zbvv.a(var2, var41, var13, var46, var31, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.a(new int[]{0})) {
               var42 = zau.a(var2, var0, var41, var13, var46, var31, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.a(new int[]{1})) {
               var42 = zau.a(var2, var0, var41, var13, var46, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.a(new int[]{2})) {
               var42 = zau.b(var2, var0, var41, var13, var46, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            } else if (var41.b(new int[]{44}) && !var38) {
               zaue.a(var2, var13, var41);
               var38 = true;
            } else if (var41.b(new int[]{35}) && !var39) {
               zaue.a(var2, var13, var41);
               var39 = true;
            } else if (var41.at()) {
               var42 = zawb.a(var2, var41, var13, var26);
               com.aspose.cells.b.a.a.ze.a(var37, (Collection)var42);
            } else if (var41.a(new int[]{12, 13})) {
               var42 = zdt.a(var2, var41, var13, var46, var31, var26);
               com.aspose.cells.b.a.a.ze.a(var35, (Collection)var42);
            }
         }

         for(var40 = 0; var40 < var33.size(); ++var40) {
            var41 = (zbcp)var33.get(var40);
            zbui.a(var2, var41.x(), var41.ag(), var13);
            zbui.a(var2, var41.y(), var41.ag(), var13);
         }

         for(var40 = 0; var40 < var33.size(); ++var40) {
            var41 = (zbcp)var33.get(var40);
            if (var41.af() == 1) {
               var45 = var14;
               var31 = var15;
               var46 = var20;
            } else {
               var45 = var17;
               var31 = var18;
               var46 = var21;
            }

            if (var41.F().getCount() > 0) {
               if (var41.ag() != 6 && var41.ag() != 7 && var41.ag() != 8) {
                  zbtx.a(var2, var41, var13, var46, var31);
               } else {
                  zbtx.b(var2, var41, var13, var45, var31);
               }
            }
         }

         zkq.a(var2, var0, var34);
         zkq.b(var2, var0, var35);
         zce.a(var2, var0, var13, var36);
         zawb.a(var2, var0, var37);
         if (var0.K().j()) {
            zbtp.a(var0, var0.K());
         }

         if (var0.i().d().g() && var0.ap().j() != 4) {
            var0.ap().b(4);
         }

         if (var43.at()) {
            zbq.a(var2, var4, var0.e(), var13);
         } else if (var0.e().q()) {
            if (var8) {
               zbq.a(var2, var0.e(), var0.E().p(), var14, var13, var10);
            } else if (var43.av()) {
               zbq.c(var2, var0.e(), var0.E().p(), var20, var13, var43);
            } else {
               zbq.a(var2, var0.e(), var0.E().p(), var20, var13, var10, var8);
            }
         }

         if (var7.at()) {
            zbq.a(var2, var5, var0.g(), var13);
         } else if (var0.g().q()) {
            if (var9) {
               zbq.a(var2, var0.g(), var0.G().p(), var17, var13, var11);
            } else if (var7.av()) {
               zbq.c(var2, var0.g(), var0.G().p(), var21, var13, var7);
            } else {
               zbq.a(var2, var0.g(), var0.G().p(), var21, var13, var11, var9);
            }
         }

         if (var0.E().q()) {
            if (var8) {
               zbq.b(var2, var0.E(), var0.e().p(), var22, var13, var43);
            } else if (var43.at()) {
               zbq.b(var2, var4, var0.E(), var13);
            } else {
               zbq.a(var2, var0.E(), var0.e().p(), var24, var13, var43);
            }
         }

         if (var0.G().q()) {
            if (var9) {
               zbq.b(var2, var0.G(), var0.g().p(), var23, var13, var7);
            } else if (var7.at()) {
               zbq.b(var2, var5, var0.G(), var13);
            } else {
               zbq.a(var2, var0.G(), var0.g().p(), var25, var13, var7);
            }
         }

         if (var0.i().d().g() && var0.ap().j() != var1) {
            var0.ap().b(var1);
         }

         for(var40 = 0; var40 < var33.size(); ++var40) {
            var41 = (zbcp)var33.get(var40);
            zbtx.a(var2, var41);
         }

         if (var0.e().K().j()) {
            var0.e().K().e().f(var0.B().a.f());
            var0.e().K().e().e(var0.B().a.e());
            zbtp.a(var0, var0.e().K());
         }

         if (var0.E().K().j()) {
            var0.E().K().e().f(var0.B().a.f());
            var0.E().K().e().e(var0.B().a.e());
            zbtp.a(var0, var0.E().K());
         }

         if (var0.g().K().j() && var5.getCount() > 0) {
            var0.g().K().e().f(var0.B().a.f());
            var0.g().K().e().e(var0.B().a.e());
            zbtp.a(var0, var0.g().K());
         }

         if (var0.G().K().j() && var5.getCount() > 0) {
            var0.G().K().e().f(var0.B().a.f());
            var0.G().K().e().e(var0.B().a.e());
            zbtp.a(var0, var0.G().K());
         }

         boolean var49;
         if (var0.u()) {
            if (var0.i().d().g() && var0.ap().j() != 4) {
               var0.ap().b(4);
            }

            var49 = a(var0.e()) || g(var0.M());
            if (var49) {
               var0.k().a.a(var0.B().a.c());
               var0.k().a.c(var0.B().a.e());
            } else {
               var0.k().a.a(var0.B().a.c());
               var0.k().a.b(var0.B().a.j());
               var0.k().a.c(var0.B().a.e());
            }

            zir.a(var2, var0.k(), var8);
            if (var0.i().d().g() && var0.ap().j() != var1) {
               var0.ap().b(var1);
            }
         }

         var49 = var0.x().b;
         if (var0.v()) {
            if (var0.i().d().g() && var0.x().d().d().g() && var0.ap().j() != 4) {
               var0.ap().b(4);
            }

            if (var5.getCount() == 0 && (var43.ag() == 44 || var43.ag() == 35 || var49)) {
               var41 = var43;
               if (var43.m() == 35 || var43.m() == 36) {
                  for(int var50 = 1; var50 < var0.z().getCount(); ++var50) {
                     if (var0.z().a(var50).k() != null && var41.D() != null && var0.z().a(var50).k().getCount() > var41.D().getCount()) {
                        var41 = var0.z().c(var50);
                     }
                  }
               }

               if ((var43.ag() != 35 || var43.H() || var4.getCount() <= 1) && !h(var0)) {
                  zalc.a(var2, var0.x(), var41);
               } else {
                  zalc.a(var2, var0.x(), var8, var43);
               }
            } else {
               zalc.a(var2, var0.x(), var8, var43);
            }

            if (var0.i().d().g() && var0.x().d().d().g() && var0.ap().j() != var1) {
               var0.ap().b(var1);
            }
         }

      }
   }

   private static void a(zif var0, boolean var1, boolean var2) {
      int var3;
      if (var0.g().q()) {
         var3 = var0.g().a();
         if (var0.e().q() && var1 == var2 && var0.e().a() == var3 && var0.E().m() != 2 && var0.G().m() != 2) {
            var0.g().d(false);
         } else if (var0.E().q() && var1 != var2 && var0.E().a() == var3) {
            var0.g().d(false);
         }
      }

      if (var0.G().q()) {
         var3 = var0.G().a();
         if (var0.E().q() && var1 == var2 && var0.E().a() == var3 && var0.e().m() != 2 && var0.g().m() != 2) {
            var0.G().d(false);
         } else if (var0.e().q() && var1 != var2 && var0.e().a() == var3) {
            var0.G().d(false);
         }
      }

   }

   private static boolean a(zif var0, com.aspose.cells.b.a.b.zp var1) {
      zakw var2 = var0.x();
      if (var0.M() != 44 && var0.M() != 49 && var0.M() != 46) {
         if (var0.M() != 35 && var0.M() != 36 && var0.M() != 47) {
            if (!var0.v()) {
               return false;
            } else if (var2.d().s()) {
               return false;
            } else if (var2.e() != 3) {
               return false;
            } else if (var2.d().b.h() >= var1.j() + var2.k()) {
               return false;
            } else if (var2.d().b.j() < var1.j() + var2.k()) {
               return false;
            } else if (var2.d().b.g() > var1.g() + var1.e() / 2) {
               return false;
            } else {
               return var2.d().b.i() >= var1.g() + var1.e() / 2;
            }
         } else {
            return false;
         }
      } else {
         return false;
      }
   }

   private static boolean h(zif var0) {
      boolean var1 = false;
      boolean var2 = false;

      for(int var3 = 1; var3 < var0.z().getCount(); ++var3) {
         if (var0.z().c(var3).b(new int[]{44})) {
            var1 = true;
         }

         if (var0.z().c(var3).b(new int[]{35})) {
            var2 = true;
         }
      }

      return var1 && var2;
   }

   static String c(zif var0) {
      zbcr var1 = var0.z();
      zbcr var2 = new zbcr(var0);
      zbcr var3 = new zbcr(var0);
      Iterator var4 = var1.iterator();

      while(var4.hasNext()) {
         zbcp var5 = (zbcp)var4.next();
         if (var5.af() == 1) {
            var2.a(var5);
         } else {
            var3.a(var5);
         }
      }

      if (var2.getCount() == 0) {
         return "Plot series are all on secondary axis. Must set one or more of Plot series on primary axis!";
      } else {
         a(var1);
         new zbcp(var0, (zbcr)null, 14);
         if (var3.getCount() > 0) {
            zbcp var6 = var3.c(0);
         } else {
            var0.g().d(false);
            var0.g().K().a("");
            var0.G().d(false);
            var0.G().K().a("");
         }

         return "";
      }
   }

   private static void a(zbcr var0) {
      Iterator var1 = var0.iterator();

      while(var1.hasNext()) {
         zbcp var2 = (zbcp)var1.next();
         var2.n(var2.m());
         switch(var2.m()) {
         case 0:
         case 14:
         case 37:
         case 40:
            var2.n(14);
            break;
         case 1:
         case 15:
         case 38:
         case 41:
            var2.n(15);
            break;
         case 2:
         case 16:
         case 39:
         case 42:
            var2.n(16);
         case 3:
         case 4:
         case 5:
         case 9:
         case 17:
         case 18:
         case 21:
         case 22:
         case 23:
         case 24:
         case 25:
         case 26:
         case 27:
         case 28:
         case 29:
         case 30:
         case 31:
         case 32:
         case 33:
         case 34:
         case 43:
         case 50:
         case 51:
         case 52:
         case 53:
         case 54:
         case 55:
         case 56:
         default:
            break;
         case 6:
            var2.n(6);
            break;
         case 7:
            var2.n(7);
            break;
         case 8:
            var2.n(8);
            break;
         case 10:
            var2.n(10);
            break;
         case 11:
            var2.n(11);
            break;
         case 12:
         case 13:
            var2.n(12);
            break;
         case 19:
            var2.n(19);
            break;
         case 20:
            var2.n(20);
            break;
         case 35:
         case 36:
         case 48:
            var2.n(35);
            break;
         case 44:
         case 45:
         case 46:
         case 47:
         case 49:
            var2.n(44);
            break;
         case 57:
         case 58:
            var2.n(57);
            break;
         case 59:
            var2.n(59);
            break;
         case 60:
         case 61:
         case 62:
         case 63:
         case 64:
            var2.n(60);
         }
      }

   }

   private static void a(zif var0, zbcr var1, zbcr var2) {
      zbcr var3 = var0.z();
      Iterator var4 = var3.iterator();

      while(var4.hasNext()) {
         zbcp var5 = (zbcp)var4.next();
         if (var5.ag() != 60 && var5.ag() != 12) {
            var5.y().a(2);
         }

         switch(var5.ag()) {
         case 12:
            if (var5.af() == 1) {
               var0.e().a(false);
            } else {
               var0.g().a(false);
            }
            break;
         case 35:
         case 44:
            if (var5.I()) {
               var5.c(true);
            }

            var0.c(false);
            if (var5.af() == 1) {
               var0.e().d(false);
               var0.e().K().a("");
               var0.E().d(false);
               var0.E().K().a("");
               var0.e().s().a(0);
               var0.e().u().a(0);
               var0.E().s().a(0);
               var0.E().u().a(0);
            } else {
               var0.g().d(false);
               var0.g().K().a("");
               var0.G().d(false);
               var0.G().K().a("");
               var0.g().s().a(0);
               var0.g().u().a(0);
               var0.G().s().a(0);
               var0.G().u().a(0);
            }
            break;
         case 57:
         case 59:
            var0.c(false);
            if (var5.af() == 1) {
               var0.e().d(1);
               var0.e().K().a("");
               var0.E().K().a("");
               var0.e().s().a(0);
               var0.e().u().a(0);
            } else {
               var0.g().d(1);
               var0.g().K().a("");
               var0.G().K().a("");
               var0.g().s().a(0);
               var0.g().u().a(0);
            }
         }
      }

   }

   private static boolean a(zbo var0, boolean var1, boolean var2) {
      if (var0.q()) {
         return false;
      } else if (!m(var0.c())) {
         return false;
      } else {
         return !var1 || var2;
      }
   }

   private static void a(zbcr var0, zbo var1) {
      boolean var2 = false;
      boolean var3 = false;
      Iterator var4 = var0.iterator();

      while(var4.hasNext()) {
         zbcp var5 = (zbcp)var4.next();
         if (var5.ag() == 60) {
            var2 = true;
         } else {
            var3 = true;
         }
      }

      if (var2 && !var3) {
         var1.a(false);
         var1.r = true;
      }

      if (var2 && var3) {
         var1.p = true;
      }

   }

   private static boolean b(zbcr var0) {
      boolean var1 = false;
      boolean var2 = false;
      Iterator var3 = var0.iterator();

      while(var3.hasNext()) {
         zbcp var4 = (zbcp)var3.next();
         if (var4.ag() == 60) {
            var1 = true;
         } else {
            var2 = true;
         }
      }

      if (var1 && !var2) {
         return true;
      } else {
         return false;
      }
   }

   static void d(zif var0) {
      zbcr var1 = var0.z();

      for(int var2 = 0; var2 < var1.getCount(); ++var2) {
         zbcp var3 = var1.c(var2);
         int var4 = var3.a();
         int var5 = var3.m();
         boolean var6 = var3.aj();
         Color var7 = var0.g(var3.aw()).a(var4);
         int var8 = var4;
         if (!var3.aw()) {
            var8 = var4 + 8;
         }

         Color var9 = var0.g(var3.aw()).a(var8);
         Color var10 = var9;
         var3.A().c(var7);
         if (var3.aw()) {
            if ((var3.z().c() == 1 || var3.z().g() && var3.z().c() != 0) && (var5 == 37 || var5 == 38 || var5 == 39 || var5 == 62 || var5 == 64 || var5 == 57)) {
               var3.z().b(var9);
            }

            if (var6) {
               if (var3.B().d() != 1) {
                  var3.B().f().b(Color.getBlack());
                  var3.B().e().c(var9);
               }

               var3.B().b(3);
            }
         } else {
            if ((var3.z().c() == 1 || var3.z().g() && var3.z().c() != 0) && (var5 == 37 || var5 == 39 || var5 == 42 || var5 == 38 || var5 == 41 || var5 == 40 || var5 == 60 || var5 == 63 || var5 == 62 || var5 == 63 || var5 == 64 || var5 == 57 || var5 == 58)) {
               var3.z().b(var9);
            }

            if (var6) {
               if (var3.B().d() == 0) {
                  var3.B().f().b(var9);
                  if (var4 % 9 != 3 && var4 % 9 != 4 && var4 % 9 != 6 && var4 % 9 != 7 && var4 % 9 != 8) {
                     var3.B().e().c(var9);
                  } else {
                     var3.B().e().c(Color.getEmpty());
                  }
               } else if (var3.B().d() != 1) {
                  var3.B().f().b(var9);
                  if (var3.B().d() != 5 && var3.B().d() != 6 && var3.B().d() != 8 && var3.B().d() != 9 && var3.B().d() != 10) {
                     var3.B().e().c(var9);
                  } else {
                     var3.B().e().c(Color.getEmpty());
                  }
               }

               if (var3.B().d() == 0) {
                  var3.B().b(zalc.a(var3, var4));
               }
            }
         }

         boolean var11 = false;
         if (var3.m() == 44 || var3.m() == 45 || var3.m() == 48 || var3.m() == 49 || var3.m() == 47 || var3.m() == 46 || var3.m() == 35 || var3.m() == 36) {
            var11 = true;
         }

         zjf var12 = var3.D();

         for(int var13 = 0; var13 < var12.getCount(); ++var13) {
            zjd var14 = var12.b(var13);
            if (var14 != null) {
               if ((!var11 || !var3.H()) && (var11 || !var3.H() || var1.getCount() != 1)) {
                  var14.i().c(var7);
                  if (var3.aw()) {
                     if ((var14.k().c() == 1 || var14.k().g() && var14.k().c() != 0) && (var5 == 37 || var5 == 38 || var5 == 39 || var5 == 62 || var5 == 64 || var5 == 57)) {
                        var14.k().b(var9);
                     }

                     if (var6) {
                        if (var14.m().d() != 1) {
                           var14.m().f().b(Color.getBlack());
                           var14.m().e().c(var10);
                        }

                        var14.m().b(3);
                     }
                  } else {
                     if ((var14.k().c() == 1 || var14.k().g() && var14.k().c() != 0) && (var5 == 37 || var5 == 39 || var5 == 42 || var5 == 38 || var5 == 41 || var5 == 40 || var5 == 60 || var5 == 61 || var5 == 62 || var5 == 63 || var5 == 64 || var5 == 57 || var5 == 59 || var5 == 58)) {
                        var14.k().b(var9);
                     }

                     if (var6) {
                        if (var14.m().d() == 0) {
                           var14.m().f().b(var10);
                           if (var4 % 9 != 3 && var4 % 9 != 4 && var4 % 9 != 6 && var4 % 9 != 7 && var4 % 9 != 8) {
                              var14.m().e().c(var10);
                           } else {
                              var14.m().e().c(Color.getEmpty());
                           }
                        } else if (var14.m().d() != 1) {
                           var14.m().f().b(var10);
                           if (var14.m().d() != 5 && var14.m().d() != 6 && var14.m().d() != 8 && var14.m().d() != 9 && var14.m().d() != 10) {
                              var14.m().e().c(var10);
                           } else {
                              var14.m().e().c(Color.getEmpty());
                           }
                        }

                        if (var14.m().d() == 0) {
                           var14.m().b(zalc.a(var3, var4));
                        }
                     }
                  }
               } else {
                  Color var16 = var0.g(var3.aw()).a(var13);
                  int var17 = var13;
                  if (!var3.aw()) {
                     var17 = var13 + 8;
                  }

                  Color var18 = var0.g(var3.aw()).a(var17);
                  var14.i().c(var16);
                  if (var3.aw()) {
                     if ((var14.k().c() == 1 || var14.k().g() && var14.k().c() != 0) && (var5 == 37 || var5 == 38 || var5 == 39 || var5 == 62 || var5 == 64 || var5 == 57)) {
                        var14.k().b(var18);
                     }

                     if (var6) {
                        if (var14.m().d() != 1) {
                           var14.m().f().b(var18);
                           var14.m().e().c(Color.getBlack());
                        }

                        var14.m().b(3);
                     }
                  } else {
                     if ((var14.k().c() == 1 || var14.k().g() && var14.k().c() != 0) && (var5 == 37 || var5 == 39 || var5 == 42 || var5 == 38 || var5 == 41 || var5 == 40 || var5 == 60 || var5 == 61 || var5 == 62 || var5 == 63 || var5 == 64 || var5 == 57 || var5 == 59 || var5 == 58)) {
                        var14.k().b(var18);
                     }

                     if (var6) {
                        if (var14.m().d() == 0) {
                           var14.m().f().b(var18);
                           if (var13 % 9 != 3 && var13 % 9 != 4 && var13 % 9 != 6 && var13 % 9 != 7 && var13 % 9 != 8) {
                              var14.m().e().c(var18);
                           } else {
                              var14.m().e().c(Color.getEmpty());
                           }
                        } else if (var14.m().d() != 1) {
                           var14.m().f().b(var10);
                           if (var14.m().d() != 5 && var14.m().d() != 6 && var14.m().d() != 8 && var14.m().d() != 9 && var14.m().d() != 10) {
                              var14.m().e().c(var10);
                           } else {
                              var14.m().e().c(Color.getEmpty());
                           }
                        }

                        if (var14.m().d() == 0) {
                           var14.m().b(zalc.a(var3, var13));
                        }
                     }
                  }
               }
            }
         }
      }

   }

   static void e(zif var0) {
      b(var0.e());
      b(var0.E());
      b(var0.g());
      b(var0.G());
      b(var0.I());
   }

   private static void b(zbo var0) {
      zbtj var1 = var0.F();
      var0.m(((int)var1.a().h() - 1) / 3 + 1);
      if (var1.a().h() < 6.0F) {
         var0.m((int)var1.a().h() / 2 + 1);
      }

      var0.n((int)((float)var0.X() * 0.7F + 0.5F));
      if (var0.Y() == var0.X()) {
         var0.n(var0.X() - 1);
      }

      if (var0.Y() < 1) {
         var0.n(1);
      }

   }

   static boolean a(int var0) {
      switch(var0) {
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 24:
      case 25:
      case 26:
      case 31:
      case 32:
      case 33:
      case 53:
      case 54:
      case 55:
         return true;
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 27:
      case 28:
      case 29:
      case 30:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      default:
         return false;
      }
   }

   private static void b(zbo var0, boolean var1) {
      zif var2 = var0.c();
      if (var0.d() == 1 || var0.d() == 3) {
         var1 = !var1;
      }

      if (var1 && var0.K().a) {
         var0.K().a(90);
      }

   }

   private static void c(zbo var0, boolean var1) {
      zif var2 = var0.c();
      if (var0.d() == 1 || var0.d() == 3) {
         var1 = !var1;
      }

      if (var1 && var0.Q().a()) {
         var0.Q().c(90);
      }

   }

   private static void a(zbo var0, com.aspose.cells.b.a.b.zp[] var1, boolean var2, com.aspose.cells.b.a.b.zs var3) {
      com.aspose.cells.b.a.b.zs var4 = new com.aspose.cells.b.a.b.zs(var3.b(), var3.c());
      zif var5 = var0.c();
      if (var0.d() == 1 || var0.d() == 3) {
         var2 = !var2;
      }

      if (var2) {
         if (var0.n) {
            var0.K().e().b.a(var1[0].c() + b / 2);
            var1[0].a(var1[0].c() + var4.b() + b);
            var1[0].c(var1[0].e() - (var4.b() + b));
         } else {
            var0.K().e().b.a(var1[0].i() - var4.b() - b / 2);
            var1[0].c(var1[0].e() - (var4.b() + b));
         }
      } else if (var0.n) {
         var0.K().e().b.b(var1[0].j() - var4.c() - b / 2);
         var1[0].d(var1[0].f() - (var4.c() + b));
      } else {
         var0.K().e().b.b(var1[0].d() + b / 2);
         var1[0].b(var1[0].d() + var4.c() + b);
         var1[0].d(var1[0].f() - (var4.c() + b));
      }

      var0.K().e().b.a(var4);
   }

   private static void a(zbo var0, com.aspose.cells.b.a.b.zp var1, boolean var2) throws Exception {
      com.aspose.cells.b.a.b.zs var3 = new com.aspose.cells.b.a.b.zs(var0.K().e().b.b().b(), var0.K().e().b.b().c());
      zif var4 = var0.c();
      if (var0.d() == 1 || var0.d() == 3) {
         var2 = !var2;
      }

      if (var2) {
         if (var0.n) {
            if (var1.c() < var3.b() + b && var0.K().e().q()) {
               var0.K().e().b.a(b);
            } else {
               var0.K().e().b.a(var1.c() - var3.b() - b / 2);
            }
         } else if (var4.a() - var1.i() < var3.b() + b / 2 && var0.K().e().q()) {
            var0.K().e().b.a(var4.a() - var3.b() - b / 2);
         } else {
            var0.K().e().b.a(var1.i() + b / 2);
         }
      } else if (var0.n) {
         if (var4.b() - var1.j() < var3.c() + b && var0.K().e().r()) {
            var0.K().e().b.b(var4.b() - var3.c() - b / 2);
         } else {
            var0.K().e().b.b(var1.j() + b / 2);
         }
      } else if (var1.d() < var3.c() + b && var0.K().e().r()) {
         var0.K().e().b.b(b);
      } else {
         var0.K().e().b.b(var1.d() - var3.c() - b / 2);
      }

   }

   private static void d(zbo var0, boolean var1) {
      zif var2 = var0.c();
      if (var0.d() == 1 || var0.d() == 3) {
         var1 = !var1;
      }

      if (var1) {
         var0.K().e().b.b(var2.B().b.d() + (var2.B().b.f() - var0.K().e().b.f()) / 2);
      } else {
         var0.K().e().b.a(var2.B().b.c() + (var2.B().b.e() - var0.K().e().b.e()) / 2);
      }

   }

   static float a(zbo var0, int var1, int var2, boolean var3) {
      return a(var0, (float)var1, (float)var2, var3);
   }

   static float a(zbo var0, float var1, float var2, boolean var3) {
      float var4 = 0.0F;
      boolean var5;
      if (var3) {
         if (var0.p()) {
            var5 = false;
         } else {
            var5 = true;
         }
      } else if (var0.p()) {
         var5 = true;
      } else {
         var5 = false;
      }

      double var6 = var0.n() ? zbuk.e(var0.l()) : var0.l();
      double var8 = var0.n() ? zbuk.e(var0.z()) : var0.z();
      double var10 = var0.n() ? zbuk.e(var0.D()) : var0.D();
      if (var0.m() == 1) {
         var6 = var8;
      }

      if (var6 > var8) {
         var6 = var8;
      }

      if (var6 < var10) {
         var6 = var10;
      }

      var0.a(var0.n() ? zbuk.f(var6) : var6);
      if (!var5) {
         var4 = (float)((double)var1 + (var8 - var6) / (var8 - var10) * (double)var2);
      } else {
         var4 = (float)((double)var1 + (var6 - var10) / (var8 - var10) * (double)var2);
      }

      return var4;
   }

   static float a(zbo var0, int var1, int var2, boolean var3, zbcr var4) {
      return a(var0, (float)var1, (float)var2, var3, var4);
   }

   static float a(zbo var0, float var1, float var2, boolean var3, zbcr var4) {
      if (var4.getCount() == 0) {
         return 0.0F;
      } else {
         float var5 = 0.0F;
         boolean var6;
         if (var3) {
            if (var0.p()) {
               var6 = false;
            } else {
               var6 = true;
            }
         } else if (var0.p()) {
            var6 = true;
         } else {
            var6 = false;
         }

         zif var7 = var0.c();
         int var8;
         int var9;
         if (var0.k() != 2) {
            var8 = a((List)var4.i());
            var9 = var8;
            if (var0.f() || var7.u()) {
               var9 = var8 + 1;
            }

            byte var10 = 1;
            if (var9 <= var10) {
               var9 = 2;
            }

            double var11 = var0.l();
            if (var0.m() == 1) {
               var11 = (double)var9;
            }

            if (var11 > (double)var9) {
               var11 = (double)var9;
            } else if (var11 < (double)var10) {
               var11 = (double)var10;
            }

            if (var4.c(0).av()) {
               var11 = var0.n() ? zbuk.e(var0.l()) : var0.l();
               double var13 = var0.n() ? zbuk.e(var0.z()) : var0.z();
               double var15 = var0.n() ? zbuk.e(var0.D()) : var0.D();
               if (var0.m() == 1) {
                  var11 = var13;
               }

               if (var11 > var13) {
                  var11 = var13;
               }

               if (var11 < var15) {
                  var11 = var15;
               }

               var0.a(var0.n() ? zbuk.f(var11) : var11);
               if (var6) {
                  var5 = (float)((double)var1 + (var13 - var11) / (var13 - var15) * (double)var2);
               } else {
                  var5 = (float)((double)var1 + (var11 - var15) / (var13 - var15) * (double)var2);
               }
            } else {
               var0.a(var11);
               if (var6) {
                  var5 = (float)((double)var1 + ((double)var9 - var11) / (double)(var9 - var10) * (double)var2);
               } else {
                  var5 = (float)((double)var1 + (var11 - (double)var10) / (double)(var9 - var10) * (double)var2);
               }
            }
         } else {
            var8 = var0.j();
            var9 = (int)var0.z();
            int var17 = (int)var0.D();
            boolean var18 = false;
            int var19;
            if (!var0.f() && !var7.u()) {
               var19 = zbq.a(var8, var9, var17, var0.c().S());
               if (var19 == 0) {
                  var19 = 1;
               }
            } else {
               var9 = zbq.a(var8, var8, 1, var9, var7.S());
               var19 = zbq.a(var8, var9, var17, var0.c().S());
            }

            int var12 = zbq.a(var8, (int)var0.l(), var7.S());
            if (var0.m() == 1) {
               var12 = var9;
            }

            if (var12 > var9) {
               var12 = var9;
            } else if (var12 < var17) {
               var12 = var17;
            }

            var0.a((double)var12);
            if (var6) {
               var5 = var1 + var2 - (float)zbq.a(var8, var12, var17, var0.c().S()) / (float)var19 * var2;
            } else {
               var5 = var1 + (float)zbq.a(var8, var12, var17, var0.c().S()) / (float)var19 * var2;
            }
         }

         return var5;
      }
   }

   private static void a(zbo var0, zbo var1, zbcr var2, zif var3) {
      int var4 = var2.c(0).ag();
      switch(var0.E()) {
      case 0:
         var0.m = 2;
         if (var1.p()) {
            var0.m = 1;
         }
         break;
      case 1:
         var0.m = 1;
         if (var1.p()) {
            var0.m = 2;
         }
         break;
      case 2:
         var0.m = 3;
         if (var1.m() == 1) {
            if (!var1.p()) {
               var0.m = 2;
            } else {
               var0.m = 1;
            }
         } else if (var1.m() == 0) {
            if (var1.d() != 1 && var1.d() != 3) {
               if (var1.d() == 0 || var1.d() == 2) {
                  if (c(var4)) {
                     var1.a(0.0D);
                  } else if (var1.d() == 2) {
                     zbo var5 = var1.c().e();
                     if (var5.q() && var5.l() == var5.D()) {
                        var1.e(1);
                        if (!var1.p()) {
                           var0.m = 2;
                        } else {
                           var0.m = 1;
                        }
                     } else {
                        var1.a(var1.D());
                     }
                  } else {
                     var1.a(var1.D());
                  }
               }
            } else {
               var1.a(0.0D);
            }
         }

         if (var1.m() == 2) {
            if (var1.k() != 2 && (var1.d() == 0 || var1.d() == 2) && var2.c(0).ag() != 12 && var2.c(0).ag() != 60) {
               int var11 = a((List)var2.i());
               int var6 = var11;
               if (var1.f() || var3.u()) {
                  var6 = var11 + 1;
               }

               byte var7 = 1;
               if (var6 <= var7) {
                  var6 = 2;
               }

               double var8 = var1.l();
               if (var1.m() == 1) {
                  var8 = (double)var6;
               }

               if (var8 > (double)var6) {
                  var8 = (double)var6;
               } else if (var8 < (double)var7) {
                  var8 = (double)var7;
               }

               if (!var1.p()) {
                  if (var8 == (double)var7) {
                     var0.m = 1;
                  }
               } else if (var8 == (double)var7) {
                  var0.m = 2;
               }
            } else {
               double var10 = var1.D();
               if (var1.l() <= var10) {
                  if (!var1.p()) {
                     var0.m = 1;
                  } else {
                     var0.m = 2;
                  }
               }
            }
         }
         break;
      case 3:
         var0.m = 0;
      }

   }

   private static void a(zif var0, zn var1, zbo var2, com.aspose.cells.b.a.b.zs var3, com.aspose.cells.b.a.b.zs var4, com.aspose.cells.b.a.b.zp[] var5, boolean var6) {
      if (var6) {
         switch(var2.m) {
         case 0:
         default:
            break;
         case 1:
            var5[0].d(var5[0].f() - var3.c());
            var5[0].d(var5[0].f() - var4.c());
            break;
         case 2:
            var5[0].b(var5[0].d() + var3.c());
            var5[0].d(var5[0].f() - var3.c());
            var5[0].b(var5[0].d() + var4.c());
            var5[0].d(var5[0].f() - var4.c());
            break;
         case 3:
            if (var0.u()) {
               var5[0].d(var5[0].f() - 5);
            }
         }
      } else {
         switch(var2.m) {
         case 0:
         case 3:
         default:
            break;
         case 1:
            if (!var0.u()) {
               var5[0].a(var5[0].c() + var3.b());
               var5[0].c(var5[0].e() - var3.b());
               var5[0].a(var5[0].c() + var4.b());
               var5[0].c(var5[0].e() - var4.b());
            } else {
               com.aspose.cells.b.a.b.zs var7 = var0.k().q();
               if (var3.b() + var4.b() > var7.b()) {
                  var5[0].a(var5[0].c() + var3.b() + var4.b() - var7.b());
                  var5[0].c(var5[0].e() - (var3.b() + var4.b() - var7.b()));
               }
            }
            break;
         case 2:
            var5[0].c(var5[0].e() - var3.b());
            var5[0].c(var5[0].e() - var4.b());
         }
      }

      zbuk.b(var5);
   }

   private static void a(zif var0, zn var1, zbo var2, com.aspose.cells.b.a.b.zs var3, com.aspose.cells.b.a.b.zp[] var4, boolean var5) {
      if (var5) {
         switch(var2.m) {
         case 1:
            var4[0].d(var4[0].f() - var3.c());
            break;
         case 2:
            var4[0].b(var4[0].d() + var3.c());
            var4[0].d(var4[0].f() - var3.c());
            break;
         case 3:
            if (var0.u()) {
               var4[0].d(var4[0].f() - 5);
            }
         }
      } else {
         switch(var2.m) {
         case 1:
            if (!var0.u()) {
               var4[0].a(var4[0].c() + var3.b());
               var4[0].c(var4[0].e() - var3.b());
            } else {
               com.aspose.cells.b.a.b.zs var6 = var0.k().q();
               if (var3.b() > var6.b()) {
                  var4[0].a(var4[0].c() + var3.b() - var6.b());
                  var4[0].c(var4[0].e() - (var3.b() - var6.b()));
               }
            }
            break;
         case 2:
            var4[0].c(var4[0].e() - var3.b());
         }
      }

      zbuk.b(var4);
   }

   private static void a(zif var0, zn var1, zbo var2, com.aspose.cells.b.a.b.zs var3, int var4, com.aspose.cells.b.a.b.zp[] var5, boolean var6) {
      com.aspose.cells.b.a.b.zp var7 = new com.aspose.cells.b.a.b.zp(var5[0].c(), var5[0].d(), var5[0].e(), var5[0].f());
      float var8 = 0.25F;
      if (var6) {
         switch(var2.m) {
         case 0:
         default:
            break;
         case 1:
            if (!var0.u()) {
               var5[0].a(var5[0].c() + var3.b() + var4);
               var5[0].c(var5[0].e() - (var3.b() + var4));
            } else {
               com.aspose.cells.b.a.b.zs var9 = var0.k().q();
               if (var3.b() + var4 > var9.b()) {
                  var5[0].a(var5[0].c() + var3.b() + var4 - var9.b());
                  var5[0].c(var5[0].e() - (var3.b() + var4 - var9.b()));
               }
            }
            break;
         case 2:
            var5[0].c(var5[0].e() - (var3.b() + var4));
            break;
         case 3:
            a(zbq.a(var2), var5, var6, var3, var4);
         }

         if (var5[0].e() < (int)((float)var7.e() * var8)) {
            var5[0].c((int)((float)var7.e() * var8));
         }
      } else {
         if (var0.u() && var2.k() != 2) {
            var2.m = 0;
            var2.f(2);
            var2.h(2);
            var4 = 0;
         }

         switch(var2.m) {
         case 0:
         default:
            break;
         case 1:
            var5[0].d(var5[0].f() - (var3.c() + var4));
            break;
         case 2:
            if (var0.u() && var2.k() == 2) {
               var5[0].b(var5[0].d() + var3.c() + var4);
               var5[0].d(var5[0].f() - (var3.c() + var4 + b));
               break;
            }

            var5[0].b(var5[0].d() + var3.c() + var4);
            var5[0].d(var5[0].f() - (var3.c() + var4));
            break;
         case 3:
            if (var0.u() && var2.k() == 2) {
               var5[0].d(var5[0].f() - b);
            } else {
               a(zbq.a(var2), var5, var6, var3, var4);
            }
         }

         if (var5[0].f() < (int)((float)var7.f() * var8)) {
            var5[0].d((int)((float)var7.f() * var8));
         }
      }

      zbuk.b(var5);
   }

   static void a(zbo var0, com.aspose.cells.b.a.b.zp[] var1, boolean var2, com.aspose.cells.b.a.b.zs var3, int var4) {
      com.aspose.cells.b.a.b.zs var5 = new com.aspose.cells.b.a.b.zs(var3.b(), var3.c());
      var5.a(var5.b() + var4);
      var5.b(var5.c() + var4);
      float var6 = (float)var1[0].d();
      float var7 = (float)var1[0].f();
      if (var2) {
         var6 = (float)var1[0].c();
         var7 = (float)var1[0].e();
      }

      double var8 = var0.n() ? zbuk.e(var0.l()) : var0.l();
      double var10 = var0.n() ? zbuk.e(var0.z()) : var0.z();
      double var12 = var0.n() ? zbuk.e(var0.D()) : var0.D();
      if (var0.m() == 1) {
         var8 = var10;
      }

      if (var8 > var10) {
         var8 = var10;
      }

      if (var8 < var12) {
         var8 = var12;
      }

      float var14 = (float)((var8 - var12) / (var10 - var12) * (double)var7);
      int var15;
      com.aspose.cells.b.a.b.zp var16;
      int var17;
      if (var2) {
         var15 = 2;

         for(var16 = new com.aspose.cells.b.a.b.zp(var1[0].c(), var1[0].d(), var1[0].e(), var1[0].f()); var15 > 0; --var15) {
            var1[0] = new com.aspose.cells.b.a.b.zp(var16.c(), var16.d(), var16.e(), var16.f());
            var17 = (int)((float)var5.b() - var14);
            if (var17 > 0) {
               if (var0.p()) {
                  var1[0].c(var1[0].e() - var17);
               } else {
                  var1[0].a(var1[0].c() + var17);
                  var1[0].c(var1[0].e() - var17);
               }
            }

            var14 = (float)var1[0].e() * var14 / (float)var16.e();
         }
      } else {
         var15 = 2;

         for(var16 = new com.aspose.cells.b.a.b.zp(var1[0].c(), var1[0].d(), var1[0].e(), var1[0].f()); var15 > 0; --var15) {
            var1[0] = new com.aspose.cells.b.a.b.zp(var16.c(), var16.d(), var16.e(), var16.f());
            var17 = (int)((float)var5.c() - var14);
            if (var17 > 0) {
               if (var0.p()) {
                  var1[0].b(var1[0].d() + var17);
                  var1[0].d(var1[0].f() - var17);
               } else {
                  var1[0].d(var1[0].f() - var17);
               }
            }

            var14 = (float)var1[0].f() * var14 / (float)var16.f();
         }
      }

   }

   private static void a(zn var0, zif var1, zbcp var2, zbcp var3, com.aspose.cells.b.a.b.zp[] var4) throws Exception {
      int var5 = var2.m();
      int var6 = var3.m();
      int var13;
      int var15;
      if (!var2.ar() && !var3.ar()) {
         if (var2.at() || var3.at()) {
            com.aspose.cells.b.a.b.zt var20 = new com.aspose.cells.b.a.b.zt((float)var1.a() * 0.3F, (float)var1.b());
            boolean var8 = var1.e().E() != 3;
            boolean var22 = var1.g().E() != 3;
            if (!var1.B().s()) {
               if (var2.at() && var8) {
                  var1.e().f = var20.b();
                  var1.e().g = var20.c();
               }

               if (var3.at() && var22) {
                  var1.g().f = var20.b();
                  var1.g().g = var20.c();
               }
            } else {
               var4[0].a(-13, -13);
               int var10 = 0;
               int var23 = 0;
               int var12 = 0;
               var13 = 0;
               com.aspose.cells.b.a.b.zg var17;
               int var18;
               com.aspose.cells.b.a.b.zs var19;
               com.aspose.cells.b.a.b.zs var25;
               String var26;
               if (var2.at() && var8) {
                  var25 = zbsp.a(var0, "a", var1.e().F().a());
                  var1.e().F().d(var25.b() / 2);
                  var12 = var1.e().F().k();

                  for(var15 = 0; var15 < var1.e().l.size(); ++var15) {
                     var26 = com.aspose.cells.b.a.zr.a(var1.e().l.get(var15));
                     var17 = var1.e().F().a();
                     var18 = var1.e().F().d();
                     var19 = zbsp.a(var1.ap(), var26, var18, var17, (com.aspose.cells.b.a.b.zt)var20, 1, 1);
                     if (var19.b() > var10) {
                        var10 = var19.b();
                     }

                     if (var19.c() > var23) {
                        var23 = var19.c();
                     }
                  }

                  var1.e().f = var20.b();
                  var1.e().g = var20.c();
               }

               if (var3.at() && var22) {
                  var25 = zbsp.a(var0, "a", var1.g().F().a());
                  var1.g().F().d(var25.b() / 2);
                  var13 = var1.g().F().k();

                  for(var15 = 0; var15 < var1.g().l.size(); ++var15) {
                     var26 = com.aspose.cells.b.a.zr.a(var1.g().l.get(var15));
                     var17 = var1.g().F().a();
                     var18 = var1.g().F().d();
                     var19 = zbsp.a(var1.ap(), var26, var18, var17, (com.aspose.cells.b.a.b.zt)var20, 1, 1);
                     if (var19.b() > var10) {
                        var10 = var19.b();
                     }

                     if (var19.c() > var23) {
                        var23 = var19.c();
                     }
                  }

                  var1.g().f = var20.b();
                  var1.g().g = var20.c();
               }

               if (var23 > 0) {
                  if (var12 < var13) {
                     var12 = var13;
                  }

                  var23 += var12;
               }

               var4[0].a(-var10, -var23);
            }

            zbuk.a(var4);
            byte var21 = 15;
            if (var4[0].e() < var21) {
               var4[0].c(var21);
            }

            if (var4[0].f() < var21) {
               var4[0].d(var21);
            }
         }
      } else {
         double var7 = 75.0D;
         double var9 = 100.0D;
         zaue.a(var1, var4, var2);
         zaue.a(var1, var4, var3);
         double var11;
         int var14;
         int var16;
         double var24;
         if (var5 != 46 && var6 != 46) {
            if (var5 != 49 && var6 != 49) {
               zbuk.a(var4);
            } else {
               if (var5 == 49) {
                  var7 = (double)var2.W();
                  var9 = (double)var2.J() / 2.0D;
               }

               if (var6 == 49) {
                  var7 = (double)var3.W();
                  var9 = (double)var3.J() / 2.0D;
               }

               var11 = (double)var4[0].e() / (2.0D + var7 / 100.0D + var9 / 100.0D);
               if (var7 <= 100.0D) {
                  if (var11 > (double)var4[0].f() / 2.0D) {
                     var11 = (double)var4[0].f() / 2.0D;
                  }

                  var1.k(zbuk.c(var11));
                  var1.l(zbuk.c(var11 * var7 / 100.0D));
                  var1.m(zbuk.c(var11 * var9 / 100.0D));
                  var13 = var4[0].e() - (2 * var1.ab() + var1.ad() + var1.ac());
                  var14 = var4[0].f() - 2 * var1.ab();
                  var4[0].a(-var13 / 2, -var14 / 2);
               } else {
                  var24 = var7 * var11 / 100.0D;
                  if (var24 > (double)var4[0].f() / 2.0D) {
                     var24 = (double)var4[0].f() / 2.0D;
                  }

                  var1.l(zbuk.c(var24));
                  var1.k(zbuk.c(var24 * 100.0D / var7));
                  var1.m(zbuk.c(var24 * 100.0D / var7 * var9 / 100.0D));
                  var15 = var4[0].e() - (2 * var1.ab() + var1.ad() + 2 * var1.ac());
                  var16 = var4[0].f() - 2 * var1.ac();
                  var4[0].a(-var15 / 2, -var16 / 2);
               }
            }
         } else {
            if (var5 == 46) {
               var7 = (double)var2.W();
               var9 = (double)var2.J();
            }

            if (var6 == 46) {
               var7 = (double)var3.W();
               var9 = (double)var3.J();
            }

            var11 = (double)var4[0].e() / (2.0D + 2.0D * var7 / 100.0D + var9 / 100.0D);
            if (var7 <= 100.0D) {
               if (var11 > (double)var4[0].f() / 2.0D) {
                  var11 = (double)var4[0].f() / 2.0D;
               }

               var1.k(zbuk.c(var11));
               var1.l(zbuk.c(var11 * var7 / 100.0D));
               var1.m(zbuk.c(var11 * var9 / 100.0D));
               var13 = var4[0].e() - (2 * var1.ab() + var1.ad() + 2 * var1.ac());
               var14 = var4[0].f() - 2 * var1.ab();
               var4[0].a(-var13 / 2, -var14 / 2);
            } else {
               var24 = var7 * var11 / 100.0D;
               if (var24 <= (double)var4[0].f() / 2.0D) {
                  var24 = (double)var4[0].f() / 2.0D;
               }

               var1.l(zbuk.c(var24));
               var1.k(zbuk.c(var24 * 100.0D / var7));
               var1.m(zbuk.c(var24 * 100.0D / var7 * var9 / 100.0D));
               var15 = var4[0].e() - (2 * var1.ab() + var1.ad() + 2 * var1.ac());
               var16 = var4[0].f() - 2 * var1.ac();
               var4[0].a(-var15 / 2, -var16 / 2);
            }
         }
      }

   }

   private static void b(zif var0, boolean var1, boolean var2) {
      a(var0.e(), var1);
      a(var0.g(), var2);
      a(var0.E(), var1);
      a(var0.G(), var2);
   }

   static void a(zbo var0, boolean var1) {
      zbo var2 = zbq.a(var0);
      if (var2 != null) {
         if (var2.m() == 1 && !var2.p()) {
            if (!var1) {
               if (var0.b()) {
                  var0.a(3);
               } else {
                  var0.a(2);
               }
            } else if (var0.b()) {
               var0.a(2);
            } else {
               var0.a(3);
            }
         } else if (var2.m() != 1 && var2.p()) {
            if (!var1) {
               if (var0.b()) {
                  var0.a(3);
               } else {
                  var0.a(2);
               }
            } else if (var0.b()) {
               var0.a(2);
            } else {
               var0.a(3);
            }
         } else if (!var1) {
            if (var0.b()) {
               var0.a(0);
            } else {
               var0.a(1);
            }
         } else if (var0.b()) {
            var0.a(1);
         } else {
            var0.a(0);
         }

         if (var0.E() == 0) {
            switch(var0.a()) {
            case 0:
               var0.a(3);
               break;
            case 1:
               var0.a(2);
               break;
            case 2:
               var0.a(1);
               break;
            case 3:
               var0.a(0);
            }
         }

      }
   }

   private static void i(zif var0) {
      c(var0.e());
      c(var0.g());
      c(var0.E());
      c(var0.G());
   }

   private static void c(zbo var0) {
      if (var0.a() == 1) {
         if (var0.n) {
            var0.b(0);
         } else {
            var0.b(1);
         }
      }

      if (var0.a() == 2) {
         if (var0.n) {
            var0.b(0);
         } else {
            var0.b(1);
         }
      }

      if (var0.a() == 0) {
         if (var0.n) {
            var0.b(3);
         } else {
            var0.b(2);
         }
      }

      if (var0.a() == 3) {
         if (var0.n) {
            var0.b(3);
         } else {
            var0.b(2);
         }
      }

   }

   static void f(zif var0) {
      ArrayList var1 = var0.z().j();
      zaky var2 = var0.k().o();

      for(int var3 = 0; var3 < var1.size(); ++var3) {
         zbcp var4 = (zbcp)var1.get(var3);
         zala var5 = new zala(var0, var0.l(), var3);
         var5.a(var4.i());
         var5.a(1);
         var5.a(var4);
         var2.a(var5);
      }

   }

   static void g(zif var0) {
      ArrayList var1 = var0.z().j();
      zakw var2 = var0.x();
      zaky var3 = var2.g();
      zaky var4 = var2.f();
      boolean var5 = true;
      boolean var6 = false;

      int var9;
      for(int var7 = 0; var7 < var1.size(); ++var7) {
         zbcp var8 = (zbcp)var1.get(var7);
         if (var7 == 0 && var8.j()) {
            var5 = false;
         }

         var9 = var8.al();
         zala var10 = var3.c(var9);
         zala var11;
         if (var10 == null) {
            var11 = new zala(var0, var2, var9);
            var11.a(var8.i());
            var11.a(1);
            var11.a(var8);
            zxp.a(var2.d().k(), var11.a());
            if (!var6) {
               var4.a(var11);
            }

            if (var8.b(new int[]{44})) {
               var6 = true;
            }
         } else if (!var10.b()) {
            var11 = new zala(var0, var2, var9);
            var11.a(var8.i());
            var11.a(1);
            var11.a(var8);
            var11.a(var10.c());
            var11.a(var10.e());
            zxp.a(var10.a(), var11.a());
            if (!var6) {
               var4.a(var11);
            }

            if (var8.b(new int[]{44})) {
               var6 = true;
            }
         }
      }

      ArrayList var14 = new ArrayList();
      if (var5) {
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().m());
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().n());
      } else {
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().n());
         com.aspose.cells.b.a.a.ze.a(var14, (Collection)var0.z().m());
      }

      int var15 = var4.getCount() > 0 ? var4.getCount() - 1 : 0;

      for(var9 = 0; var9 < var14.size(); ++var9) {
         zbtt var16 = (zbtt)var14.get(var9);
         int var17 = var1.size() + var16.u();
         zala var12 = var3.c(var17);
         zala var13;
         if (var12 == null) {
            var13 = new zala(var0, var2, var17);
            var13.a(var16.m());
            var13.a(2);
            var13.a(var16.e().a());
            var13.a(var16);
            zxp.a(var2.d().k(), var13.a());
            a(var13, var4, var15);
         } else if (!var12.b()) {
            var13 = new zala(var0, var2, var17);
            var13.a(var16.m());
            var13.a(2);
            var13.a(var16.e().a());
            var13.a(var16);
            var13.a(var12.c());
            var13.a(var12.e());
            zxp.a(var12.a(), var13.a());
            a(var13, var4, var15);
         }
      }

   }

   private static void a(zala var0, zaky var1, int var2) {
      if (var1.getCount() == 0) {
         var1.a(var0);
      } else {
         boolean var3 = false;

         for(int var4 = var2; var4 < var1.getCount(); ++var4) {
            if (var1.b(var4).f() > var0.f()) {
               var1.a(var4, var0);
               var3 = true;
               break;
            }
         }

         if (!var3) {
            var1.a(var0);
         }
      }

   }

   static void a(zif var0, zbcp var1) {
      zakw var2 = var0.x();
      zaky var3 = var2.g();
      zaky var4 = var2.f();
      ArrayList var5;
      if (var1.af() == 1) {
         var5 = var0.z().c();
      } else {
         var5 = var0.z().d();
      }

      for(int var6 = 0; var6 < var1.D().getCount(); ++var6) {
         zjd var7 = var1.D().b(var6);
         zala var9 = var3.c(var6);
         int var10 = var6 + 1;
         String var11 = com.aspose.cells.b.a.zo.a(var10);
         if (var5.size() > var6) {
            zfo var12 = (zfo)var5.get(var6);
            var11 = zalc.a(var0, var12, var0.S());
         }

         zala var13;
         if (var9 == null) {
            var13 = new zala(var0, var2, var6);
            var13.a(var11);
            var13.a(1);
            var13.a(var1);
            zxp.a(var2.d().k(), var13.a());
            var4.a(var13);
         } else if (!var9.b()) {
            var13 = new zala(var0, var2, var6);
            var13.a(var11);
            var13.a(1);
            var13.a(var1);
            var13.a(var9.c());
            var13.a(var9.e());
            zxp.a(var9.a(), var13.a());
            var4.a(var13);
         }
      }

   }

   static int a(List var0) {
      ArrayList var1 = new ArrayList();

      for(int var2 = 0; var2 < var0.size(); ++var2) {
         com.aspose.cells.b.a.a.ze.a(var1, (Object)((zbcp)((zbcp)var0.get(var2))).D().getCount());
      }

      Collections.sort(var1);
      return var1.size() == 0 ? 0 : (Integer)var1.get(var1.size() - 1);
   }

   static boolean a(List var0, double[] var1, double[] var2, zbo var3) {
      ArrayList var4 = b(var0);
      var1[0] = 0.0D;
      var2[0] = 0.0D;
      int var5 = 0;

      for(int var6 = 0; var6 < var4.size(); ++var6) {
         double var7 = 0.0D;
         double var9 = 0.0D;
         double[] var11 = new double[]{var7};
         double[] var12 = new double[]{var9};
         boolean var13 = b((ArrayList)var4.get(var6), var11, var12, var3);
         var7 = var11[0];
         var9 = var12[0];
         if (var6 == var5 && !var13) {
            ++var5;
         } else if (var6 == var5) {
            var1[0] = var7;
            var2[0] = var9;
         } else {
            if (var7 < var1[0]) {
               var1[0] = var7;
            }

            if (var9 > var2[0]) {
               var2[0] = var9;
            }
         }
      }

      if (!var3.M()) {
         var1[0] = var3.n() ? zbuk.e(var3.D()) : var3.D();
      }

      if (!var3.N()) {
         var2[0] = var3.n() ? zbuk.e(var3.z()) : var3.z();
      }

      return c(var0);
   }

   private static ArrayList b(List var0) {
      zbcp var1 = (zbcp)var0.get(0);
      ArrayList var2 = new ArrayList();
      ArrayList var3 = new ArrayList();
      ArrayList var4 = new ArrayList();
      Iterator var5 = var0.iterator();

      while(var5.hasNext()) {
         zbcp var6 = (zbcp)var5.next();
         if (var6.a(new int[]{var1.m()})) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
         } else {
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var6);
         }
      }

      if (var4.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      ArrayList var9 = new ArrayList();
      if (var3.size() > 0) {
         var1 = (zbcp)var3.get(0);
         ArrayList var10 = new ArrayList();
         com.aspose.cells.b.a.a.ze.a(var10, (Collection)var3);
         var3.clear();
         Iterator var7 = var10.iterator();

         while(var7.hasNext()) {
            zbcp var8 = (zbcp)var7.next();
            if (var8.a(new int[]{var1.m()})) {
               com.aspose.cells.b.a.a.ze.a(var9, (Object)var8);
            } else {
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var8);
            }
         }
      }

      if (var9.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var9);
      }

      if (var3.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      }

      return var2;
   }

   private static boolean b(ArrayList var0, double[] var1, double[] var2, zbo var3) {
      boolean var4 = false;
      zbct var5 = new zbct();
      Collections.sort(var0, var5);
      var1[0] = 0.0D;
      var2[0] = 0.0D;
      zbcp var6 = (zbcp)var0.get(0);
      int var7;
      int var8;
      int var10;
      double var11;
      double var13;
      int var17;
      zbcp var18;
      zjd var19;
      double var20;
      double var23;
      if (var6.an()) {
         var4 = true;
         if (var6.ao()) {
            var7 = a((List)var0);

            for(var8 = 0; var8 < var7; ++var8) {
               var23 = 0.0D;

               for(int var25 = 0; var25 < var0.size(); ++var25) {
                  zbcp var12 = (zbcp)var0.get(var25);
                  if (!var12.an()) {
                     break;
                  }

                  zjd var26 = var12.D().b(var8);
                  if (var26 != null) {
                     double var14 = var3.n() ? var26.y() : var26.v();
                     if (var6.m() == 4) {
                        var14 = Math.abs(var14);
                     }

                     var23 += var14;
                     if (var25 == 0 && var8 == 0) {
                        var1[0] = var23;
                        var2[0] = var23;
                     } else {
                        if (var23 < var1[0]) {
                           var1[0] = var23;
                        }

                        if (var23 > var2[0]) {
                           var2[0] = var23;
                        }
                     }
                  }
               }
            }
         } else {
            var7 = a(var0, var3);
            new ArrayList();
            int var9 = a((List)var0);

            for(var10 = 0; var10 < var9; ++var10) {
               var11 = 0.0D;
               var13 = 0.0D;
               boolean var15 = false;
               boolean var16 = false;

               for(var17 = 0; var17 < var0.size(); ++var17) {
                  var18 = (zbcp)var0.get(var17);
                  if (!var18.an()) {
                     break;
                  }

                  var19 = var18.D().b(var10);
                  if (var19 != null) {
                     var20 = var3.n() ? var19.y() : var19.v();
                     if (var17 == 0 && var10 == 0) {
                        if (var7 == 1) {
                           var1[0] = var20;
                        } else if (var7 == 2) {
                           var2[0] = var20;
                        }
                     } else if (var17 == 0) {
                        if (var7 == 1 && var20 < var1[0]) {
                           var1[0] = var20;
                        } else if (var7 == 2 && var20 > var2[0]) {
                           var2[0] = var20;
                        }
                     }

                     if (var20 < 0.0D) {
                        var16 = true;
                        var13 += var20;
                     }

                     if (var20 > 0.0D) {
                        var15 = true;
                        var11 += var20;
                     }
                  }
               }

               if (var16 && var13 < var1[0]) {
                  var1[0] = var13;
               }

               if (var15 && var11 > var2[0]) {
                  var2[0] = var11;
               }
            }
         }

         if (var3.n()) {
            var2[0] = zbuk.e(var2[0]);
            var1[0] = zbuk.e(var1[0]);
         }
      } else if (var6.ap()) {
         var4 = true;
         if (var6.aq()) {
            var7 = a((List)var0);

            for(var8 = 0; var8 < var7; ++var8) {
               var23 = 0.0D;
               var11 = 0.0D;
               var13 = 0.0D;
               double var27 = 0.0D;

               for(var17 = 0; var17 < var0.size(); ++var17) {
                  var18 = (zbcp)var0.get(var17);
                  if (!var18.ap()) {
                     break;
                  }

                  var19 = var18.D().b(var8);
                  if (var19 != null) {
                     var20 = var19.v();
                     if (var6.m() == 5) {
                        var20 = Math.abs(var20);
                     }

                     var23 += var20;
                     var11 += Math.abs(var20);
                     if (var23 < var13) {
                        var13 = var23;
                     }

                     if (var23 > var27) {
                        var27 = var23;
                     }
                  }
               }

               if (var11 != 0.0D) {
                  var17 = (int)(100.0D * var13 / var11);
                  if ((double)var17 < var1[0]) {
                     var1[0] = (double)var17;
                  }

                  var17 = (int)(100.0D * var27 / var11);
                  if ((double)var17 > var2[0]) {
                     var2[0] = (double)var17;
                  }
               }
            }
         } else {
            var7 = a((List)var0);

            for(var8 = 0; var8 < var7; ++var8) {
               var23 = 0.0D;
               var11 = 0.0D;
               var13 = 0.0D;

               for(int var28 = 0; var28 < var0.size(); ++var28) {
                  zbcp var29 = (zbcp)var0.get(var28);
                  if (!var29.ap()) {
                     break;
                  }

                  zjd var31 = var29.D().b(var8);
                  if (var31 != null) {
                     double var30 = var31.v();
                     var23 += Math.abs(var30);
                     if (var30 < 0.0D) {
                        var13 += var30;
                     }

                     if (var30 > 0.0D) {
                        var11 += var30;
                     }
                  }
               }

               if (var23 != 0.0D) {
                  if ((double)((int)(100.0D * var13 / var23)) < var1[0]) {
                     var1[0] = (double)((int)(100.0D * var13 / var23));
                  }

                  if ((double)((int)(100.0D * var11 / var23)) > var2[0]) {
                     var2[0] = (double)((int)(100.0D * var11 / var23));
                  }
               }
            }
         }
      } else {
         boolean var22 = true;

         for(var8 = 0; var8 < var0.size(); ++var8) {
            zjf var24 = ((zbcp)((zbcp)var0.get(var8))).D();

            for(var10 = 0; var10 < var24.getCount(); ++var10) {
               if (var24.a(var10) == null || !var24.a(var10).a()) {
                  if (var24.a(var10) != null && var24.a(var10).e()) {
                     var4 = true;
                  } else {
                     var11 = var24.a(var10) == null ? 0.0D : var24.a(var10).v();
                     if (var22) {
                        var1[0] = var11;
                        var2[0] = var11;
                        var4 = true;
                        var22 = false;
                     } else {
                        if (var11 < var1[0]) {
                           var1[0] = var11;
                        }

                        if (var11 > var2[0]) {
                           var2[0] = var11;
                        }
                     }
                  }
               }
            }
         }
      }

      return var4;
   }

   static int a(ArrayList var0, zbo var1) {
      boolean var2 = false;
      boolean var3 = false;

      for(int var4 = 0; var4 < var0.size(); ++var4) {
         zjf var5 = ((zbcp)((zbcp)var0.get(var4))).D();

         for(int var6 = 0; var6 < var5.getCount(); ++var6) {
            zjd var7 = var5.b(var6);
            if (var7 != null) {
               double var8 = var1.n() ? var7.y() : var7.v();
               if (var8 > 0.0D) {
                  var2 = true;
               } else if (var8 < 0.0D) {
                  var3 = true;
               }
            }
         }
      }

      if (var2 && !var3) {
         return 1;
      } else if (!var2 && var3) {
         return 2;
      } else {
         return 3;
      }
   }

   private static boolean b(List var0, double[] var1, double[] var2, zbo var3) {
      var1[0] = Double.MAX_VALUE;
      var2[0] = -1.7976931348623157E308D;

      for(int var4 = 0; var4 < var0.size(); ++var4) {
         zbcp var5 = (zbcp)var0.get(var4);
         zjf var6 = var5.D();
         double var7 = Double.MAX_VALUE;
         double var9 = -1.7976931348623157E308D;
         boolean var11 = true;

         for(int var12 = 0; var12 < var6.getCount(); ++var12) {
            if (var6.a(var12) != null && !var6.a(var12).b()) {
               double var13 = var6.a(var12).q();
               if (var11) {
                  var7 = var13;
                  var9 = var13;
                  var11 = false;
               }

               if (var13 < var7) {
                  var7 = var13;
               }

               if (var13 > var9) {
                  var9 = var13;
               }
            }
         }

         if (var11) {
            var7 = 0.0D;
            var9 = 0.0D;
         }

         double var18 = 0.0D;
         double var14 = 0.0D;

         for(int var16 = 0; var16 < var5.F().getCount(); ++var16) {
            zbtt var17 = var5.F().c(var16);
            if (var17.d().e()) {
               if (var17.i() > var18) {
                  var18 = var17.i();
               }

               if (var17.f() > var14) {
                  var14 = var17.f();
               }
            }
         }

         var7 -= var14;
         var9 += var18;
         if (var7 < var1[0]) {
            var1[0] = var7;
         }

         if (var9 > var2[0]) {
            var2[0] = var9;
         }
      }

      if (!var3.M()) {
         var1[0] = var3.n() ? zbuk.e(var3.D()) : var3.D();
      }

      if (!var3.N()) {
         var2[0] = var3.n() ? zbuk.e(var3.z()) : var3.z();
      }

      return d(var0);
   }

   private static boolean a(zif var0, List var1, List var2) {
      if (var2.size() > 0 && var1.size() > 0) {
         zbo var3 = var0.E();
         zbo var4 = var0.G();
         zbcp var5 = (zbcp)var1.get(0);
         zbcp var6 = (zbcp)var2.get(0);
         if (var5.ag() != 14 && var5.ag() != 15 && var5.ag() != 16 && var5.ag() != 60) {
            if (var5.ag() != 6 && var5.ag() != 7 && var5.ag() != 8) {
               if (var5.ag() != 57) {
                  return false;
               }

               if (var6.ag() != 57) {
                  return false;
               }
            } else if (var6.ag() != 6 && var6.ag() != 7 && var6.ag() != 8) {
               return false;
            }
         } else if (var6.ag() != 14 && var6.ag() != 15 && var6.ag() != 16 && var6.ag() != 60) {
            return false;
         }

         return !var3.q() || !var4.q();
      } else {
         return false;
      }
   }

   private static zbo j(zif var0) {
      zbo var1 = var0.E();
      zbo var2 = var0.G();
      return !var1.q() && var2.q() ? var2 : var1;
   }

   private static zbo k(zif var0) {
      zbo var1 = var0.E();
      zbo var2 = var0.G();
      return !var1.q() && var2.q() ? var1 : var2;
   }

   static boolean a(ArrayList var0, ArrayList var1, double[] var2, double[] var3, zbo var4) {
      double var5 = 0.0D;
      double var7 = 0.0D;
      double[] var9 = new double[]{var5};
      double[] var10 = new double[]{var7};
      a(var0, var9, var10, var4);
      var5 = var9[0];
      var7 = var10[0];
      double var11 = 0.0D;
      double var13 = 0.0D;
      double[] var15 = new double[]{var11};
      double[] var16 = new double[]{var13};
      a(var1, var15, var16, var4);
      var11 = var15[0];
      var13 = var16[0];
      if (var5 < var11) {
         var2[0] = var5;
      } else {
         var2[0] = var11;
      }

      if (var7 < var13) {
         var3[0] = var13;
      } else {
         var3[0] = var7;
      }

      if (!var4.M()) {
         var2[0] = var4.n() ? zbuk.e(var4.D()) : var4.D();
      }

      if (!var4.N()) {
         var3[0] = var4.n() ? zbuk.e(var4.z()) : var4.z();
      }

      return c((List)var0) && c((List)var1);
   }

   static void a(ArrayList var0, double[] var1, double[] var2, zbo var3) {
      ArrayList var4 = b((List)var0);
      var1[0] = 0.0D;
      var2[0] = 0.0D;

      for(int var5 = 0; var5 < var4.size(); ++var5) {
         double var6 = 0.0D;
         double var8 = 0.0D;
         double[] var10 = new double[]{var6};
         double[] var11 = new double[]{var8};
         b((ArrayList)var4.get(var5), var10, var11, var3);
         var6 = var10[0];
         var8 = var11[0];
         if (var5 == 0) {
            var1[0] = var6;
            var2[0] = var8;
         } else {
            if (var6 < var1[0]) {
               var1[0] = var6;
            }

            if (var8 > var2[0]) {
               var2[0] = var8;
            }
         }
      }

   }

   private static void a(zbo var0, zbo var1) {
      var0.l = var1.l;
      var0.d(var1.z());
      var0.f(var1.D());
      var0.g(var1.y());
      var0.c(var1.x());
      var0.i(var1.C());
      var0.e(var1.B());
   }

   private static void d(zbo var0) {
      var0.a = var0.l;
      var0.b = var0.z();
      var0.c = var0.D();
      var0.d = var0.x();
      var0.e = var0.B();
   }

   private static boolean c(List var0) {
      boolean var1 = true;
      Iterator var2 = var0.iterator();

      while(var2.hasNext()) {
         zbcp var3 = (zbcp)var2.next();
         if (!var3.ae()) {
            var1 = false;
         }
      }

      return var1;
   }

   private static boolean d(List var0) {
      boolean var1 = true;
      Iterator var2 = var0.iterator();

      while(var2.hasNext()) {
         zbcp var3 = (zbcp)var2.next();
         if (!var3.ad()) {
            var1 = false;
         }
      }

      return var1;
   }

   static void a(zn var0, zbo var1, double var2, double var4, boolean var6, ArrayList var7, int var8, com.aspose.cells.b.a.b.zp var9, boolean var10, zbcp var11) {
      if (var1.n()) {
         a(var0, var1, var2, var4, var7, var8, var9, var10, var11);
      } else {
         double var12 = var2;
         double var14 = var4;
         zif var16 = var1.c();
         boolean var17 = b(var8);
         double var18;
         double var20;
         if (var2 == var4 && var2 == 0.0D) {
            var18 = 1.2D;
            if (d(var8) || var17 || var1.c().U() || f(var8) || !var6) {
               var18 = 1.0D;
            }

            var1.d(var18);
            var2 = var18;
            var12 = var18;
            var1.f(0.0D);
            if (var17 && "".equals(var1.G().b())) {
               var1.G().a("0.00%");
               var1.G().a(false);
            }
         } else if (var2 <= var4) {
            double[] var22;
            double[] var23;
            if (!var1.N() && var1.M()) {
               var18 = 0.0D;
               if (var1.O()) {
                  var20 = 0.0D;
                  var22 = new double[]{var18};
                  var23 = new double[]{var20};
                  a(var2, var22, var23);
                  var18 = var22[0];
                  var20 = var23[0];
               } else {
                  var18 = var1.x();
               }

               if (var1.z() > 0.0D) {
                  var4 = 0.0D;
               } else if (var18 == 0.0D) {
                  var4 = -1.0D;
               } else {
                  var4 = var2 - Math.abs(var18) * 10.0D;
               }
            } else if (var1.N() && !var1.M()) {
               var18 = 0.0D;
               if (var1.O()) {
                  var20 = 0.0D;
                  var22 = new double[]{var18};
                  var23 = new double[]{var20};
                  a(var4, var22, var23);
                  var18 = var22[0];
                  var20 = var23[0];
               } else {
                  var18 = var1.x();
               }

               if (var1.D() < 0.0D) {
                  var2 = 0.0D;
               } else if (var18 == 0.0D) {
                  var2 = 1.0D;
               } else {
                  var2 = var4 + Math.abs(var18) * 10.0D;
               }
            }
         }

         boolean var39 = var1.N();
         boolean var19 = var1.M();
         var20 = 0.0D;
         byte var40 = 1;
         if (var17) {
            if (var2 == 100.0D && var1.N()) {
               var1.d(100.0D);
            }

            if (var4 == -100.0D && var1.M()) {
               var1.f(-100.0D);
            }
         }

         double var42 = 0.0D;
         double var25 = 0.0D;
         double[] var27 = new double[]{var42};
         double[] var28 = new double[]{var25};
         double[] var29 = new double[]{var4};
         double[] var30 = new double[]{var2};
         double[] var31 = new double[]{var20};
         int[] var32 = new int[]{var40};
         a(var27, var28, var29, var30, var31, var32, var1, var10, var12, var14, var39, var19, var17);
         var42 = var27[0];
         var25 = var28[0];
         var4 = var29[0];
         var2 = var30[0];
         var20 = var31[0];
         int var41 = var32[0];
         if (!var1.P()) {
            if (!var1.O() && var1.x() < var1.B()) {
               throw new IllegalArgumentException("The numbers you specified can't be used because the interval for the minor unittick marks must be less than or equal to the interval for the major unit tick marks!");
            }

            if (var20 < var1.B()) {
               var20 = var1.B();
            }
         }

         a(var1, var41, var20, var25, var42, var7, var12, var14, var39, var19, var17);
         int var43 = a(var0, var1, var10, var11, var9);
         boolean var44 = false;
         int var45;
         if (var1.c().U()) {
            if (var10) {
               var45 = (int)var1.c().N().g();
            } else {
               var45 = (int)var1.c().N().i();
            }
         } else if (var10) {
            var45 = var9.e();
         } else {
            var45 = var9.f();
         }

         boolean var46 = false;
         if (var9.f() <= 15 || var9.f() <= var16.E().G().a().d()) {
            var46 = true;
         }

         byte var47 = 3;
         if (var46) {
            var47 = 2;
         }

         double var48 = var20;
         int var33 = var7.size();

         for(int var34 = var43; var1.O() && var7.size() > var47 && var43 > var45 && var45 != 0; var34 = var43) {
            double var35 = 0.0D;
            double[] var37 = new double[]{var20};
            double[] var38 = new double[]{var35};
            a(var20, var37, var38);
            var20 = var37[0];
            var35 = var38[0];
            var20 *= 10.0D;
            a(var1, var41, var20, var25, var42, var7, var12, var14, var39, var19, var17);
            var43 = a(var0, var1, var10, var11, var9);
            if (var48 == var20 || var33 == var7.size() || var34 == var43) {
               if (var20 != var48) {
                  var20 = var48;
                  a(var1, var41, var48, var25, var42, var7, var12, var14, var39, var19, var17);
               }
               break;
            }

            var48 = var20;
            var33 = var7.size();
         }

         if (var7.size() >= 2) {
            var1.d((Double)var7.get(0));
            var1.f((Double)var7.get(var7.size() - 1));
            if (var1.O()) {
               var1.c(var20);
            }

            if (var1.P()) {
               var1.e(var1.x() / 5.0D);
            }
         }

      }
   }

   private static void a(double[] var0, double[] var1, double[] var2, double[] var3, double[] var4, int[] var5, zbo var6, boolean var7, double var8, double var10, boolean var12, boolean var13, boolean var14) {
      double var15 = 0.0D;
      double var17 = 0.0D;
      double var19 = 0.0D;
      double var21 = 0.0D;
      double var23 = zbuk.a(var3[0], zbuk.g(var3[0]));
      double var25 = zbuk.a(var2[0], zbuk.g(var2[0]));
      double var40;
      if (var6.O()) {
         boolean var27 = true;
         double[] var28 = new double[]{var19};
         double[] var29 = new double[]{var15};
         a(var2[0], var28, var29);
         var19 = var28[0];
         var15 = var29[0];
         double[] var30 = new double[]{var21};
         double[] var31 = new double[]{var17};
         a(var3[0], var30, var31);
         var21 = var30[0];
         var17 = var31[0];
         var1[0] = var2[0] < var15 ? var2[0] : var15;
         var0[0] = var3[0] > var17 ? var3[0] : var17;
         if (Math.abs(var21) > Math.abs(var19)) {
            var4[0] = Math.abs(var21);
         } else {
            var4[0] = Math.abs(var19);
         }

         double var32;
         double var34;
         double var36;
         double[] var38;
         double[] var39;
         int var42;
         double var43;
         if (var23 != var25 && var3[0] > 0.0D && var2[0] > 0.0D) {
            var32 = zbuk.a(var3[0], var2[0]);
            var34 = 0.0D;
            var36 = 0.0D;
            var38 = new double[]{var34};
            var39 = new double[]{var36};
            a(var32, var38, var39);
            var34 = var38[0];
            var36 = var39[0];
            if (var2[0] / var32 < 5.0D) {
               if (var6.M()) {
                  var1[0] = 0.0D;
               }

               if (var6.M() && var6.N()) {
                  var6.f(0.0D);
               } else if (!var6.M() && var6.N()) {
                  var4[0] = Math.abs(var34);
               }
            } else {
               var1[0] = zbuk.a(var2[0], var36) / 2.0D;
               var0[0] = var2[0] + var36;
               var4[0] = Math.abs(var34);
               if (var6.d() != 0 && var6.d() != 2) {
                  if (zbuk.a(var3[0], var2[0]) / var4[0] >= 8.0D) {
                     a(var4);
                  }
               } else if (zbuk.a(var3[0], var2[0]) / var4[0] >= 9.0D) {
                  a(var4);
               }

               var40 = var4[0];
               var42 = zbuk.g(var40);
               var43 = 0.0D;
               var43 = zbuk.a(Math.floor((3.0D * var2[0] - var3[0]) / (2.0D * var4[0])) * var4[0], var42);
               if (var6.M() && var6.N()) {
                  var6.f(var43);
                  var1[0] = var43;
               }
            }
         } else if (var23 != var25 && var3[0] < 0.0D && var2[0] < 0.0D) {
            var32 = var2[0] - var3[0];
            var34 = 0.0D;
            var36 = 0.0D;
            var38 = new double[]{var34};
            var39 = new double[]{var36};
            a(var32, var38, var39);
            var34 = var38[0];
            var36 = var39[0];
            if (var2[0] / var32 < 5.0D) {
               if (var6.N()) {
                  var0[0] = 0.0D;
               }

               if (var6.N() && var6.M()) {
                  var6.d(0.0D);
               } else if (!var6.N() && var6.M()) {
                  var4[0] = Math.abs(var34);
               }
            } else {
               var0[0] = var3[0] - var36 / 2.0D;
               var1[0] = var3[0] + var36;
               var4[0] = Math.abs(var34);
               if ((var3[0] - var2[0]) / var4[0] >= 8.0D) {
                  a(var4);
               }

               var40 = var4[0];
               var42 = zbuk.g(var40);

               for(var43 = 0.0D; var43 - 3.0D * var4[0] > var3[0]; var43 -= var4[0]) {
                  var43 = zbuk.a(var43, var42);
               }

               if (var6.N() && var6.M()) {
                  var6.d(var43);
                  var0[0] = var43;
               }
            }
         } else if (var23 != var25 && var3[0] > 0.0D && var2[0] < 0.0D) {
            var32 = var3[0] - var2[0];
            var34 = 0.0D;
            var36 = 0.0D;
            var38 = new double[]{var34};
            var39 = new double[]{var36};
            a(var32, var38, var39);
            var34 = var38[0];
            var36 = var39[0];
            var4[0] = Math.abs(var34);
            if ((var3[0] - var2[0]) / var4[0] > 9.5D) {
               a(var4);
            }
         }

         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var2[0] == 0.0D || var3[0] == var2[0] && var3[0] > 0.0D) {
               var6.f(0.0D);
               var5[0] = 2;
               var1[0] = 0.0D;
            }

            if (var3[0] == 0.0D || var3[0] == var2[0] && var3[0] < 0.0D) {
               var6.d(0.0D);
               var5[0] = 1;
               var0[0] = 0.0D;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = var6.z();
            var3[0] = var6.z();
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = var6.D();
            var2[0] = var6.D();
         } else {
            var5[0] = 2;
            var1[0] = var6.D();
            var0[0] = var6.z();
            var2[0] = var6.D();
            var3[0] = var6.z();
            var32 = zbuk.a(var3[0], var2[0]);
            var34 = 0.0D;
            var36 = 0.0D;
            var38 = new double[]{var34};
            var39 = new double[]{var36};
            a(var32, var38, var39);
            var34 = var38[0];
            var36 = var39[0];
            var4[0] = var34;
         }

         if ((!var7 || e(var6.c().M())) && var27) {
            a(var6, var1[0], var0[0], var4, var5[0], var8, var10, var12, var13, var14);
         }
      } else {
         var4[0] = var6.x();
         var1[0] = var2[0];
         var0[0] = var3[0];
         double[] var33;
         double var35;
         int var37;
         double var45;
         double var46;
         double var47;
         double[] var48;
         double var49;
         double var50;
         if (var23 != var25 && var3[0] > 0.0D && var2[0] > 0.0D) {
            var45 = var3[0] - var2[0];
            var46 = 0.0D;
            var47 = 0.0D;
            var33 = new double[]{var46};
            var48 = new double[]{var47};
            a(var45, var33, var48);
            var46 = var33[0];
            var47 = var48[0];
            if (var2[0] / var45 < 5.0D) {
               if (var6.M() && var6.N()) {
                  var6.f(0.0D);
                  var2[0] = var6.D();
               }

               var1[0] = 0.0D;
            } else {
               var1[0] = var2[0] - var47 / 2.0D;
               var0[0] = var2[0] + var47;
               var35 = Math.abs(var46);
               var37 = zbuk.g(var35);

               for(var49 = 0.0D; var49 < var1[0]; var49 += var35) {
                  var49 = zbuk.a(var49, var37);
               }

               if (var6.M() && var6.N()) {
                  var40 = var4[0];
                  var37 = zbuk.g(var40);

                  for(var50 = 0.0D; var50 <= var49; var50 += var4[0]) {
                     var50 = zbuk.a(var50, var37);
                  }

                  if (var6.d() != 0 && var6.d() != 2) {
                     var6.f(var50 - var4[0]);
                  } else {
                     var6.f(var50);
                  }

                  var2[0] = var6.D();
                  var1[0] = var6.D();
               }
            }
         } else if (var23 != var25 && var3[0] < 0.0D && var2[0] < 0.0D) {
            var45 = var2[0] - var3[0];
            var46 = 0.0D;
            var47 = 0.0D;
            var33 = new double[]{var46};
            var48 = new double[]{var47};
            a(var45, var33, var48);
            var46 = var33[0];
            var47 = var48[0];
            if (var2[0] / var45 < 5.0D) {
               if (var6.N() && var6.M()) {
                  var6.d(0.0D);
                  var3[0] = var6.z();
               }

               var0[0] = 0.0D;
            } else {
               var0[0] = var3[0] - var47 / 2.0D;
               var1[0] = var3[0] + var47;
               var35 = Math.abs(var46);
               var37 = zbuk.g(var35);

               for(var49 = 0.0D; var49 > var0[0]; var49 -= var35) {
                  var49 = zbuk.a(var49, var37);
               }

               if (var6.N() && var6.M()) {
                  var40 = var4[0];
                  var37 = zbuk.g(var40);

                  for(var50 = 0.0D; var50 >= var49; var50 -= var4[0]) {
                     var50 = zbuk.a(var50, var37);
                  }

                  if (var6.d() != 0 && var6.d() != 2) {
                     var6.d(var50 + var4[0]);
                  } else {
                     var6.d(var50);
                  }

                  var3[0] = var6.z();
                  var0[0] = var6.z();
               }
            }
         }

         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var2[0] == 0.0D) {
               var6.f(0.0D);
               var5[0] = 2;
               var1[0] = 0.0D;
            }

            if (var3[0] == 0.0D) {
               var6.d(0.0D);
               var5[0] = 1;
               var0[0] = 0.0D;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = var6.z();
            var3[0] = var6.z();
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = var6.D();
            var2[0] = var6.D();
         } else {
            var5[0] = 2;
            var1[0] = var6.D();
            var0[0] = var6.z();
            var2[0] = var6.D();
            var3[0] = var6.z();
         }
      }

   }

   private static boolean l(zif var0) {
      if (var0.M() != 5 && var0.M() != 4) {
         return var0.U() || var0.M() == 57 || var0.M() == 59 || var0.M() == 58;
      } else {
         return false;
      }
   }

   private static void a(zbo var0, int var1, double var2, double var4, double var6, ArrayList var8, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      zif var16 = var0.c();
      boolean var17 = e(var16.M()) && var0.b();
      boolean var18 = l(var0.c());
      char var19 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      var8.clear();
      double var20;
      int var24;
      double var25;
      if (var1 == 1) {
         var20 = var6;

         for(var24 = zbuk.g(var2); var20 >= var4 || zbuk.a(var4, var20) < var2 || var4 == var2 && var20 > 0.0D || var4 == var20 || zbuk.a(var4, var20) == var2 && var8.size() < 3; var20 -= var2) {
            var20 = zbuk.a(var20, var24);
            if (!var0.M() && var20 < var0.D()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.D());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }

         if (var14) {
            var25 = Double.MAX_VALUE;
            if (var8.size() > 0) {
               var25 = (Double)var8.get(var8.size() - 1);
            }

            if (zbuk.a(var11, var25) <= var2 || var25 == 0.0D && !var17) {
               if ((var11 - var6) / (var25 - var6) > 0.9523809523809523D && (var25 != 0.0D || var17)) {
                  var20 = zbuk.a(var25 - var2, var24);
                  com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
               }
            } else {
               var25 += var2;
               if ((var11 - var6) / (var25 - var6) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            }
         }
      } else if (var1 == 2) {
         var20 = var4;

         for(var24 = zbuk.g(var2); var20 <= var6 || var20 < var6 + var2 || var20 == var2 && var6 > 0.0D || var20 == var6 || var20 == var6 + var2 && var8.size() < 3; var20 += var2) {
            var20 = zbuk.a(var20, var24);
            if (!var0.N() && var20 > var0.z()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.z());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }

         if (var13) {
            var25 = -2.147483648E9D;
            if (var8.size() > 0) {
               var25 = (Double)var8.get(var8.size() - 1);
            }

            if (zbuk.a(var25, var9) > var2 && (var25 != 0.0D || var17)) {
               var25 -= var2;
               if ((var9 - var4) / (var25 - var4) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var4) / (var25 - var4) > 0.9523809523809523D && (var25 != 0.0D || var17)) {
               var20 = zbuk.a(var25 + var2, var24);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }

         Collections.reverse(var8);
      } else {
         var20 = 0.0D;

         for(var24 = zbuk.g(var2); var20 <= var6 || zbuk.a(var20, var6) < var2 || var20 == var2 && var6 > 0.0D || var20 == var6 || zbuk.a(var20, var6) == var2 && var8.size() < 3; var20 += var2) {
            var20 = zbuk.a(var20, var24);
            if (!var0.N() && var20 > var0.z()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.z());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }

         if (var13) {
            var25 = -2.147483648E9D;
            if (var8.size() > 0) {
               var25 = (Double)var8.get(var8.size() - 1);
            }

            if (var25 - var9 > var2) {
               var25 -= var2;
               if ((var9 - var11) / (var25 - var11) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var11) / (var25 - var11) > 0.9523809523809523D) {
               var20 = zbuk.a(var25 + var2, var24);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }

         Collections.reverse(var8);

         for(var20 = 0.0D - var2; var20 >= var4 || zbuk.a(var4, var20) < var2 || var4 == var2 && var20 > 0.0D || var4 == var20 || zbuk.a(var4, var20) == var2 && var8.size() < 3; var20 -= var2) {
            var20 = zbuk.a(var20, var24);
            if (!var0.M() && var20 < var0.D()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.D());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }

         if (var14) {
            var25 = Double.MAX_VALUE;
            if (var8.size() > 0) {
               var25 = (Double)var8.get(var8.size() - 1);
            }

            if (var11 - var25 > var2) {
               var25 += var2;
               if ((var11 - var9) / (var25 - var9) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var9) / (var25 - var9) > 0.9523809523809523D) {
               var20 = zbuk.a(var25 - var2, var24);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var20);
            }
         }
      }

      if (var8.size() >= 2) {
         if ((var15 || var18) && var9 > 0.0D && (Double)var8.get(0) >= var9 + var2 && (Double)var8.get(0) != 0.0D && var13 && var8.size() >= 3) {
            var8.remove(0);
         }

         if ((var15 || var18) && var11 < 0.0D && (Double)var8.get(var8.size() - 1) <= zbuk.a(var11, var2) && (Double)var8.get(var8.size() - 1) != 0.0D && var14 && var8.size() >= 3) {
            var8.remove(var8.size() - 1);
         }
      }

   }

   static int a(zn var0, zbo var1, boolean var2, zbcp var3, com.aspose.cells.b.a.b.zp var4) {
      if (var1.E() == 3) {
         return 0;
      } else {
         int var5 = var3.ag();
         zbtj var6 = var1.F();
         zjd var7 = var3.D().b(0);
         String var8 = var7.z();
         boolean var9 = var7.A();
         boolean var10 = false;
         if (var6.h() && var7 != null) {
            var10 = true;
         }

         String var11 = "";

         for(int var12 = 0; var12 < var1.l.size(); ++var12) {
            double var13 = com.aspose.cells.b.a.ze.g(var1.l.get(var12));
            if (b(var5)) {
               var13 /= 100.0D;
               var8 = "0%";
            }

            String var15 = "";
            var13 *= Math.pow(10.0D, var1.Q().f());
            if (var10) {
               var15 = zpv.a(var1.c().al(), var13, var8, var9);
            } else {
               var15 = zbq.a((zbo)var1, (Object)var13);
            }

            if (var15.length() > var11.length()) {
               var11 = var15;
            }
         }

         com.aspose.cells.b.a.b.zs var16 = new com.aspose.cells.b.a.b.zs(var4.e(), var4.f());
         new com.aspose.cells.b.a.b.zs();
         com.aspose.cells.b.a.b.zs var17;
         if (var6.d() == 0) {
            var17 = zbsp.a(var1.c().ap(), var11, var6.d(), var6.a(), (com.aspose.cells.b.a.b.zs)var16, 1, 1);
         } else {
            var17 = zbsp.a(var1.c().ap(), var11, var6.d(), var6.a(), (com.aspose.cells.b.a.b.zs)var16, 1, 1);
         }

         float var14 = 0.0F;
         if (var2) {
            var14 = (float)(var17.b() * (var1.l.size() - 1));
         } else {
            var14 = (float)(var17.c() * (var1.l.size() - 1));
         }

         return (int)((double)var14 + 0.5D);
      }
   }

   private static void a(double var0, double[] var2, double[] var3) {
      boolean var4 = true;
      if (var0 < 0.0D) {
         var4 = false;
      }

      var0 = Math.abs(var0);
      var2[0] = 0.0D;
      var3[0] = 0.0D;
      if (var0 > 1.0D) {
         b(var0, var2, var3);
      } else {
         if (var0 == 0.0D) {
            return;
         }

         int var5 = zbuk.g(var0);
         double var6 = var0 * Math.pow(10.0D, (double)var5);
         b(var6, var2, var3);
         var2[0] /= Math.pow(10.0D, (double)var5);
         var3[0] /= Math.pow(10.0D, (double)var5);
      }

      if (!var4) {
         var2[0] = -var2[0];
         var3[0] = -var3[0];
      }

   }

   private static void b(double var0, double[] var2, double[] var3) {
      char var4 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      var0 = Math.abs(var0);
      var2[0] = 1.0D;
      var3[0] = 1.0D;
      String var5 = com.aspose.cells.b.a.zn.b(var0);
      String var6 = "";
      if (var5.indexOf("E") > 0) {
         String[] var7 = com.aspose.cells.b.a.zv.d(var5, 'E');
         var5 = var7[0];
         var6 = "E" + var7[1];
      }

      int var11 = com.aspose.cells.b.a.zo.a(Character.toString(var5.charAt(0)));
      int var8 = 0;
      if (var5.length() > 1) {
         if (var5.charAt(1) != var4) {
            var8 = com.aspose.cells.b.a.zo.a(Character.toString(var5.charAt(1)));
         } else {
            var8 = com.aspose.cells.b.a.zo.a(Character.toString(var5.charAt(2)));
         }
      }

      int var9;
      if (var11 == 1) {
         var9 = var8 / 2;
         ++var9;
         var8 = var9 * 2;
         var2[0] = 2.0D;
      } else if (var11 < 5) {
         if (var8 % 5 > 0) {
            ++var11;
            var8 = 0;
         } else {
            var8 = 5;
         }

         var2[0] = 5.0D;
      } else {
         ++var11;
         var2[0] = 10.0D;
         var8 = 0;
      }

      var9 = var5.length();
      int var10 = var5.indexOf(var4, 0);
      if (var10 > 0) {
         var9 = var10;
      }

      if ("".equals(var6)) {
         var2[0] *= Math.pow(10.0D, (double)(var9 - 2));
         var3[0] = (double)(var11 * 10 + var8) * Math.pow(10.0D, (double)(var9 - 2));
      } else {
         var2[0] *= Math.pow(10.0D, (double)(var9 - 2));
         var3[0] = (double)(var11 * 10 + var8) * Math.pow(10.0D, (double)(var9 - 2));
         var2[0] = com.aspose.cells.b.a.ze.g(com.aspose.cells.b.a.zn.b(var2[0]) + var6);
         var3[0] = com.aspose.cells.b.a.ze.g(com.aspose.cells.b.a.zn.b(var3[0]) + var6);
      }

   }

   private static void a(double[] var0) {
      char var1 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      boolean var2 = true;
      if (var0[0] < 0.0D) {
         var2 = false;
      }

      var0[0] = Math.abs(var0[0]);
      int var3 = 1;
      String var4;
      if (var0[0] > 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);
         var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(0)));
      } else if (var0[0] == 0.0D) {
         var0[0] = 0.0D;
         return;
      }

      if (var0[0] < 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);

         for(int var5 = 0; var5 < var4.length(); ++var5) {
            if (var4.charAt(var5) != '0' && var4.charAt(var5) != var1) {
               var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(var5)));
               break;
            }
         }
      }

      if (var3 != 1 && var3 != 5) {
         var0[0] = var0[0] * 5.0D / 2.0D;
      } else {
         var0[0] = 2.0D * var0[0];
      }

      if (!var2) {
         var0[0] = -var0[0];
      }

   }

   private static void b(double[] var0) {
      char var1 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      boolean var2 = true;
      if (var0[0] < 0.0D) {
         var2 = false;
      }

      var0[0] = Math.abs(var0[0]);
      int var3 = 1;
      String var4;
      if (var0[0] > 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);
         var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(0)));
      } else if (var0[0] == 0.0D) {
         var0[0] = 0.0D;
         return;
      }

      if (var0[0] < 1.0D) {
         var4 = com.aspose.cells.b.a.zn.b(var0[0]);

         for(int var5 = 0; var5 < var4.length(); ++var5) {
            if (var4.charAt(var5) != '0' && var4.charAt(var5) != var1) {
               var3 = com.aspose.cells.b.a.zo.a(Character.toString(var4.charAt(var5)));
               break;
            }
         }
      }

      if (var3 != 1 && var3 != 2) {
         var0[0] = var0[0] * 2.0D / 5.0D;
      } else {
         var0[0] /= 2.0D;
      }

      if (!var2) {
         var0[0] = -var0[0];
      }

   }

   static boolean b(int var0) {
      switch(var0) {
      case 2:
      case 5:
      case 8:
      case 11:
      case 16:
      case 20:
      case 23:
      case 26:
      case 30:
      case 33:
      case 39:
      case 42:
      case 52:
      case 55:
         return true;
      case 3:
      case 4:
      case 6:
      case 7:
      case 9:
      case 10:
      case 12:
      case 13:
      case 14:
      case 15:
      case 17:
      case 18:
      case 19:
      case 21:
      case 22:
      case 24:
      case 25:
      case 27:
      case 28:
      case 29:
      case 31:
      case 32:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 40:
      case 41:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 53:
      case 54:
      default:
         return false;
      }
   }

   static boolean c(int var0) {
      switch(var0) {
      case 12:
      case 13:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
         return true;
      default:
         return false;
      }
   }

   private static boolean d(int var0) {
      switch(var0) {
      case 1:
      case 4:
      case 7:
      case 10:
      case 15:
      case 19:
      case 22:
      case 25:
      case 29:
      case 32:
      case 38:
      case 41:
      case 51:
      case 54:
         return true;
      case 2:
      case 3:
      case 5:
      case 6:
      case 8:
      case 9:
      case 11:
      case 12:
      case 13:
      case 14:
      case 16:
      case 17:
      case 18:
      case 20:
      case 21:
      case 23:
      case 24:
      case 26:
      case 27:
      case 28:
      case 30:
      case 31:
      case 33:
      case 34:
      case 35:
      case 36:
      case 37:
      case 39:
      case 40:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 52:
      case 53:
      default:
         return false;
      }
   }

   private static boolean e(int var0) {
      return var0 == 13 || var0 == 12;
   }

   private static boolean f(int var0) {
      return var0 == 57 || var0 == 58 || var0 == 59;
   }

   static void a(zbo var0, double var1, double var3, double[] var5, int var6, double var7, double var9, boolean var11, boolean var12, boolean var13) {
      double var14 = var1;
      double var16 = var3;
      boolean var18 = e(var0.c().M()) && var0.b();
      boolean var19 = l(var0.c());
      double var20 = var5[0];
      int var22 = zbuk.g(var20);
      double var23;
      if (var6 == 1) {
         var23 = var3;
         if (!var0.M()) {
            var14 = var0.D();
         } else {
            while(true) {
               if (var23 < var1 && var1 - var23 >= var5[0]) {
                  var20 = var5[0];
                  if ((var13 || l(var0.c())) && var14 <= zbuk.a(var9, var20) && var14 != 0.0D && var12) {
                     var20 = var5[0];
                     var14 = zbuk.b(var14, var20);
                     var20 = var5[0];
                  }

                  if ((zbuk.a(var9, var14) <= var5[0] || var14 == 0.0D && !var18) && (var9 - var3) / (var14 - var3) > 0.9523809523809523D && (var14 != 0.0D || var18)) {
                     var14 = zbuk.a(var14 - var5[0], var22);
                  }
                  break;
               }

               var23 = zbuk.a(var23, var22);
               var14 = var23;
               var20 = var5[0];
               var23 = zbuk.a(var23, var20);
            }
         }
      } else if (var6 == 2) {
         var23 = var1;
         if (!var0.N()) {
            var16 = var0.z();
         } else {
            for(var20 = var5[0]; var23 <= var3 || var23 < var3 + var5[0]; var23 = zbuk.b(var23, var20)) {
               var23 = zbuk.a(var23, var22);
               var16 = var23;
            }

            if ((var13 || l(var0.c())) && var16 >= var7 + var5[0] && var16 != 0.0D && var11) {
               var16 = zbuk.a(var16, var20);
            }

            if ((zbuk.a(var16, var7) <= var5[0] || var16 == 0.0D && !var18) && (var7 - var1) / (var16 - var1) > 0.9523809523809523D && (var16 != 0.0D || var18)) {
               var16 = zbuk.a(var16 + var5[0], var22);
            }
         }
      } else {
         var23 = 0.0D;
         if (!var0.M()) {
            var14 = var0.D();
         } else {
            var20 = var5[0];

            while(true) {
               if (var23 < var1 && var1 - var23 >= var5[0]) {
                  var20 = var5[0];
                  if ((var13 || l(var0.c())) && var14 <= zbuk.a(var9, var20) && var14 != 0.0D && var12) {
                     var14 = zbuk.b(var14, var20);
                  }

                  if ((zbuk.a(var9, var14) <= var5[0] || var14 == 0.0D) && (var9 - var3) / (var14 - var3) > 0.9523809523809523D && var14 != 0.0D) {
                     var14 = zbuk.a(var14 - var5[0], var22);
                  }
                  break;
               }

               var23 = zbuk.a(var23, var22);
               var14 = var23;
               var23 = zbuk.a(var23, var20);
            }
         }

         var23 = 0.0D;
         if (!var0.N()) {
            var16 = var0.D();
         } else {
            for(var20 = var5[0]; var23 <= var3 || var23 < var3 + var5[0]; var23 = zbuk.b(var23, var20)) {
               var23 = zbuk.a(var23, var22);
               var16 = var23;
            }

            if ((var13 || l(var0.c())) && var16 >= var7 + var5[0] && var16 != 0.0D && var11) {
               var16 = zbuk.a(var16, var20);
            }

            if ((zbuk.a(var16, var7) <= var5[0] || var16 == 0.0D) && (var7 - var1) / (var16 - var1) > 0.9523809523809523D && var16 != 0.0D) {
               var16 = zbuk.a(var16 + var5[0], var22);
            }
         }
      }

      var23 = var5[0];
      double var25 = (var16 - var14) / var5[0];
      int var27 = e(var0.c().M()) ? 10 : 11;
      if (var0.c().U()) {
         var27 = 13;
      } else if (var16 > 0.0D && var14 < 0.0D) {
         var27 = 12;
      }

      if (var25 >= (double)var27) {
         a(var5);
      } else {
         b(var5);
         if (var16 - var14 > 10.0D * var5[0]) {
            var5[0] = var23;
         }
      }

   }

   static void a(zbo var0, double var1, double var3, int var5, float var6, boolean var7, zbcp var8, boolean var9, boolean var10, boolean var11) {
      zif var12 = var0.c();
      ArrayList var13 = var0.l;
      if (var0.E() != 3) {
         if (var13.size() > 2) {
            double var14 = var1;
            if (var1 == var3 && var1 == 0.0D) {
               var0.d(1.0D);
               var1 = 1.0D;
               var14 = 1.0D;
               var0.f(0.0D);
               var9 = false;
               var10 = false;
            }

            if (var7 && var11) {
               boolean var18 = b(var5);
               if (var18) {
                  if (var1 == 100.0D && var9) {
                     var0.d(100.0D);
                  }

                  if (var3 == -100.0D && var10) {
                     var0.f(-100.0D);
                  }
               }

               boolean var19 = true;
               double var20 = (Double)var0.l.get(var0.l.size() - 1);
               double var22 = (Double)var0.l.get(0);
               byte var27;
               if (var9 && var10) {
                  var27 = 3;
                  if (var20 == 0.0D) {
                     var27 = 2;
                  }

                  if (var22 == 0.0D) {
                     var27 = 1;
                  }
               } else if (!var9 && var10) {
                  var27 = 1;
               } else {
                  var27 = 2;
               }

               double var24 = var0.x();
               double[] var26 = new double[]{var24};
               a(var26, var0, var8, var6, var27, var20, var22, var14, var3, var9, var10, var18);
               var24 = var26[0];
               if (var13.size() >= 2) {
                  var0.d((Double)var13.get(0));
                  var0.f((Double)var13.get(var13.size() - 1));
                  var0.c(var24);
                  if (var0.P()) {
                     var0.e(var0.x() / 5.0D);
                  }
               }
            }

         }
      }
   }

   private static void a(double[] var0, zbo var1, zbcp var2, float var3, int var4, double var5, double var7, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      zif var16 = var1.c();
      ArrayList var17 = var1.l;
      if (var1.E() != 3) {
         if (var17.size() > 2) {
            float var18 = 0.0F;
            var18 = var1.F().l();
            float var19 = var3 / (float)(var1.l.size() - 1);
            double var20;
            if (var19 / var18 > 9.0F && (l(var16) || !var13 || !var14)) {
               b(var0);
               if ((Double)var17.get(0) - (Double)var17.get(var17.size() - 1) > 11.0D * var0[0]) {
                  a(var0);
               } else {
                  var20 = var0[0];
                  b(var1, var4, var20, var5, var7, var17, var9, var11, var13, var14, var15);
               }
            } else if (var19 / var18 < 3.0F) {
               a(var0);
               var20 = var0[0];
               b(var1, var4, var20, var5, var7, var17, var9, var11, var13, var14, var15);
               a(var0, var1, var2, var3, var4, var5, var7, var9, var11, var13, var14, var15);
            }

         }
      }
   }

   private static void b(zbo var0, int var1, double var2, double var4, double var6, ArrayList var8, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      zif var16 = var0.c();
      boolean var17 = l(var0.c());
      char var18 = com.aspose.cells.b.a.ze.a(com.aspose.cells.b.a.c.zc.a().c());
      var8.clear();
      double var19;
      int var21;
      double var22;
      if (var1 == 1) {
         var19 = var6;

         for(var21 = zbuk.g(var2); var19 >= var4 || var4 - var19 < var2; var19 -= var2) {
            var19 = zbuk.a(var19, var21);
            if (!var14 && var19 < var0.D()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.D());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         if (var14) {
            var22 = Double.MAX_VALUE;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var11 - var22 > var2 && var22 != 0.0D) {
               var22 += var2;
               if ((var11 - var6) / (var22 - var6) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var6) / (var22 - var6) > 0.9523809523809523D && var22 != 0.0D) {
               var19 = zbuk.a(var22 - var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }
      } else if (var1 == 2) {
         var19 = var4;

         for(var21 = zbuk.g(var2); var19 <= var6 || var19 < var6 + var2; var19 += var2) {
            var19 = zbuk.a(var19, var21);
            if (!var13 && var19 > var0.z()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.z());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         if (var13) {
            var22 = -2.147483648E9D;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var22 - var9 > var2 && var22 != 0.0D) {
               var22 -= var2;
               if ((var9 - var4) / (var22 - var4) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var4) / (var22 - var4) > 0.9523809523809523D && var22 != 0.0D) {
               var19 = zbuk.a(var22 + var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         Collections.reverse(var8);
      } else {
         var19 = 0.0D;

         for(var21 = zbuk.g(var2); var19 <= var6 || var19 - var6 < var2; var19 += var2) {
            var19 = zbuk.a(var19, var21);
            com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
         }

         if (var13) {
            var22 = -2.147483648E9D;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var22 - var9 > var2) {
               var22 -= var2;
               if ((var9 - var11) / (var22 - var11) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var9 - var11) / (var22 - var11) > 0.9523809523809523D) {
               var19 = zbuk.a(var22 + var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }

         Collections.reverse(var8);

         for(var19 = 0.0D - var2; var19 >= var4 || var4 - var19 < var2; var19 -= var2) {
            var19 = zbuk.a(var19, var21);
            com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
         }

         if (var14) {
            var22 = Double.MAX_VALUE;
            if (var8.size() > 0) {
               var22 = (Double)var8.get(var8.size() - 1);
            }

            if (var11 - var22 > var2) {
               var22 += var2;
               if ((var11 - var9) / (var22 - var9) <= 0.9523809523809523D) {
                  var8.remove(var8.size() - 1);
               }
            } else if ((var11 - var9) / (var22 - var9) > 0.9523809523809523D) {
               var19 = zbuk.a(var22 - var2, var21);
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var19);
            }
         }
      }

      if (var8.size() >= 2) {
         if ((var15 || l(var16)) && (Double)var8.get(0) >= var9 + var2 && (Double)var8.get(0) != 0.0D && var13 && var8.size() > 3) {
            var8.remove(0);
         }

         if ((var15 || l(var16)) && (Double)var8.get(var8.size() - 1) <= var11 - var2 && (Double)var8.get(var8.size() - 1) != 0.0D && var14 && var8.size() > 3) {
            var8.remove(var8.size() - 1);
         }
      }

   }

   static void a(zn var0, zbo var1, ArrayList var2, com.aspose.cells.b.a.b.zp var3, int var4, zbcr var5, boolean var6) throws Exception {
      var2.clear();
      zif var7 = var1.c();
      int var8 = a((List)var5.i());
      boolean var17;
      if (c(var4) && !var1.p) {
         double var21 = 0.0D;
         double var11 = 0.0D;
         boolean var13 = var1.N();
         boolean var25 = var1.M();
         double[] var30 = new double[]{var21};
         double[] var29 = new double[]{var11};
         var17 = b((List)var5.i(), var30, var29, var1);
         var21 = var30[0];
         var11 = var29[0];
         a(var0, var1, var11, var21, var17, var2, var4, var3, true, var5.c(0));
      } else {
         zbcr var9 = new zbcr(var7);
         zbcr var10 = new zbcr(var7);
         new ArrayList();
         double var12 = 0.0D;
         if (var1.p) {
            Iterator var14 = var5.iterator();

            while(var14.hasNext()) {
               zbcp var15 = (zbcp)var14.next();
               if (var15.ag() == 60) {
                  var9.a(var15);
               } else {
                  var10.a(var15);
               }
            }

            double var22 = 0.0D;
            boolean var16 = var1.N();
            var17 = var1.M();
            double[] var18 = new double[]{var22};
            double[] var19 = new double[]{var12};
            b((List)var9.i(), var18, var19, var1);
            var22 = var18[0];
            var12 = var19[0];
            var12 = Math.ceil(var12);
         } else {
            var10 = var5;
         }

         e(var1);
         if (var1.k() == 2) {
            a(var0, var1, var3, var4, var10, var6);
         } else {
            new ArrayList();
            ArrayList var23;
            if (var1.d() == 0) {
               var23 = var7.z().c();
            } else {
               var23 = var7.z().d();
            }

            int var24;
            zfo var26;
            zbcp var27;
            int var28;
            if (var23.size() > 0) {
               for(var24 = 0; var24 < var23.size() && var24 < var8; ++var24) {
                  var26 = (zfo)var23.get(var24);
                  com.aspose.cells.b.a.a.ze.a(var2, var26.a());
               }

               for(var24 = 0; var24 < var10.getCount(); ++var24) {
                  var27 = var10.c(var24);

                  for(var28 = 0; var28 < var27.D().getCount(); ++var28) {
                     var27.D().b(var28).a((double)(var28 + 1));
                  }
               }
            } else if (var4 == 44) {
               for(var24 = 1; var24 <= var10.a(0).k().getCount(); ++var24) {
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var24);
                  var26 = new zfo((zfo)null, var24);
                  com.aspose.cells.b.a.a.ze.a(var23, (Object)var26);
               }
            } else {
               for(var24 = 1; var24 <= var8; ++var24) {
                  com.aspose.cells.b.a.a.ze.a(var2, (Object)var24);
                  var26 = new zfo((zfo)null, var24);
                  com.aspose.cells.b.a.a.ze.a(var23, (Object)var26);
               }

               if (var1.p) {
                  for(var24 = var8 + 1; (double)var24 <= var12; ++var24) {
                     com.aspose.cells.b.a.a.ze.a(var2, (Object)var24);
                     var26 = new zfo((zfo)null, var24);
                     com.aspose.cells.b.a.a.ze.a(var23, (Object)var26);
                  }
               }

               for(var24 = 0; var24 < var10.getCount(); ++var24) {
                  var27 = var10.c(var24);

                  for(var28 = 0; var28 < var27.D().getCount(); ++var28) {
                     var27.D().b(var28).a((double)(var28 + 1));
                  }
               }
            }

            if (var1.p) {
               var1.f(1.0D);
               var1.d((double)var8 > var12 ? (double)var8 : var12);
            } else {
               var1.f(1.0D);
               var1.d((double)var8);
            }

            var1.c(1.0D);
            var1.e(var1.x() / 2.0D);
         }

      }
   }

   private static void e(zbo var0) {
      if (var0.k() == 0) {
         zif var1 = var0.c();
         new ArrayList();
         ArrayList var2;
         ArrayList[] var3;
         if (var0.d() == 0) {
            var2 = var1.z().c();
            var3 = var1.z().e();
         } else {
            var2 = var1.z().d();
            var3 = var1.z().g();
         }

         if (var3 == null) {
            if (var2.size() > 0) {
               zfo var4 = (zfo)var2.get(0);
               if (var4.f() && a(var1.al(), var4.c(), var4.a())) {
                  boolean var5 = true;

                  for(int var6 = 1; var6 < var2.size(); ++var6) {
                     zfo var7 = (zfo)var2.get(var6);
                     if (!var7.g()) {
                        boolean var8 = false;
                        if (var7.a() == null) {
                           var8 = true;
                        }

                        if (var7.a().equals("")) {
                           var8 = true;
                        }

                        if (var8) {
                           var5 = false;
                           break;
                        }

                        boolean var9 = false;
                        int var10 = zamo.a(var7.a().getClass());
                        switch(var10) {
                        case 3:
                        case 9:
                        case 14:
                        case 16:
                           var9 = true;
                        }

                        if (!var9) {
                           var5 = false;
                           break;
                        }
                     }
                  }

                  if (var5) {
                     var0.d(2);
                  }
               }
            }

         }
      }
   }

   static boolean a(zbo var0) {
      if (var0.k() != 0) {
         return var0.k() == 2;
      } else {
         zif var1 = var0.c();
         new ArrayList();
         ArrayList var2;
         ArrayList[] var3;
         if (var0.d() == 0) {
            var2 = var1.z().c();
            var3 = var1.z().e();
         } else {
            var2 = var1.z().d();
            var3 = var1.z().g();
         }

         if (var3 != null) {
            return false;
         } else {
            if (var2.size() > 0) {
               zfo var4 = (zfo)var2.get(0);
               if (var4.f() && a(var1.al(), var4.c(), var4.a())) {
                  boolean var5 = true;
                  boolean var6 = true;

                  for(int var7 = 1; var7 < var2.size(); ++var7) {
                     zfo var8 = (zfo)var2.get(var7);
                     if (!var8.g()) {
                        boolean var9 = false;
                        if (var8.a() == null) {
                           var9 = true;
                        }

                        if (var8.a().equals("")) {
                           var9 = true;
                        }

                        var6 = false;
                        if (var9) {
                           var5 = false;
                           break;
                        }

                        boolean var10 = false;
                        int var11 = zamo.a(var8.a().getClass());
                        switch(var11) {
                        case 3:
                        case 9:
                        case 14:
                        case 16:
                           var10 = true;
                        }

                        if (!var10) {
                           var5 = false;
                           break;
                        }
                     }
                  }

                  if (var5 && !var6) {
                     return true;
                  }
               }
            }

            return false;
         }
      }
   }

   private static boolean a(zxx var0, String var1, Object var2) {
      if (var1 == null) {
         return false;
      } else {
         zafy var3 = var0.a(var1, false);
         int var4 = var0.a(var3, var2);
         return var4 == 3;
      }
   }

   private static boolean g(int var0) {
      switch(var0) {
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 24:
      case 25:
      case 26:
      case 31:
      case 32:
      case 33:
      case 53:
      case 54:
      case 55:
         return true;
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 27:
      case 28:
      case 29:
      case 30:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      default:
         return false;
      }
   }

   private static void a(zn var0, zbo var1, com.aspose.cells.b.a.b.zp var2, int var3, zbcr var4, boolean var5) throws Exception {
      zif var6 = var1.c();
      ArrayList var7 = var1.l;
      new ArrayList();
      ArrayList var8;
      if (var1.d() == 0) {
         var8 = var6.z().c();
      } else {
         var8 = var6.z().d();
      }

      int var9 = a((List)var4.i());
      boolean var10 = false;
      if (var8.size() == 0) {
         var10 = true;
      }

      ArrayList var11 = new ArrayList();
      ArrayList var12;
      int var14;
      zfo var16;
      int var22;
      if (var8.size() > 0) {
         if (var9 < var8.size()) {
            com.aspose.cells.b.a.a.ze.a(var8, var9, var8.size() - var9);
         }

         new ArrayList();
         var12 = (ArrayList)var8.clone();
         boolean var13 = true;

         zfo var15;
         for(var14 = 0; var14 < var12.size(); ++var14) {
            var15 = (zfo)var12.get(var14);
            if (!var15.g()) {
               var13 = false;
               break;
            }
         }

         if (var13) {
            var14 = 1;

            for(var22 = 0; var22 < var12.size(); ++var22) {
               var16 = (zfo)var12.get(var22);
               var16.a((Object)var14);
               var14 = zbq.a(var1.j(), var1.y(), (int)var1.x(), var14, var6.S());
            }
         }

         for(var14 = 0; var14 < var12.size(); ++var14) {
            var15 = (zfo)var12.get(var14);
            int var25 = a(var15.a(), var1.c().S());
            if (var25 >= 0) {
               com.aspose.cells.b.a.a.ze.a(var11, (Object)var25);
            } else if (!var15.g()) {
               var10 = true;
               var11.clear();
               var8.clear();
               break;
            }
         }
      }

      int var20;
      if (var10) {
         String var18 = "";
         if (var1.j() == 1) {
            var18 = "M/d/yyyy";
         } else if (var1.j() == 2) {
            var18 = "MMM-yy";
         } else {
            var18 = "yyyy";
         }

         for(var20 = 1; var20 <= var9; ++var20) {
            zfo var23 = new zfo((zfo)null, var20);
            var23.a(false);
            var23.a(var18);
            com.aspose.cells.b.a.a.ze.a(var8, (Object)var23);
            com.aspose.cells.b.a.a.ze.a(var11, (Object)var20);
         }
      }

      for(int var19 = 0; var19 < var4.getCount(); ++var19) {
         zbcp var21 = var4.c(var19);

         for(var14 = 0; var14 < var8.size(); ++var14) {
            zjd var24 = var21.D().b(var14);
            if (var24 != null) {
               var16 = (zfo)var8.get(var14);
               int var17 = a(var16.a(), var1.c().S());
               var24.a((double)var17);
            }
         }
      }

      var12 = new ArrayList();
      com.aspose.cells.b.a.a.ze.a(var12, (Collection)var11);
      Collections.sort(var12);
      if (var1.N() && var12.size() > 0) {
         var1.d((double)zbq.a(var1.j(), (Integer)var12.get(var12.size() - 1), var6.S()));
      }

      if (var1.M() && var12.size() > 0) {
         var1.f((double)zbq.a(var1.j(), (Integer)var12.get(0), var6.S()));
      }

      if (var1.r() && var12.size() > 0) {
         var20 = b((List)var12, var6.S());
         var1.c(var20);
      }

      a(var0, var1, var2, var3, var5, var10);
      var20 = (int)var1.D();
      var14 = (int)var1.z();
      var7.clear();
      com.aspose.cells.b.a.a.ze.a(var7, (Object)var20);
      var22 = zbq.a(var1.j(), var1.y(), (int)var1.x(), var20, var6.S());
      double var26 = (double)var20;
      if ((double)var20 + var1.x() == 60.0D && var22 == 61) {
         var22 = 60;
      }

      while(var14 - var22 >= 0) {
         com.aspose.cells.b.a.a.ze.a(var7, (Object)var22);
         var26 = (double)var22;
         var22 = zbq.a(var1.j(), var1.y(), (int)var1.x(), var22, var6.S());
         if (var26 + var1.x() == 60.0D && var22 == 61) {
            var22 = 60;
         }
      }

   }

   private static int b(List var0, boolean var1) {
      byte var2 = 3;
      byte var3 = 28;

      for(int var4 = 0; var4 < var0.size() - 1; ++var4) {
         DateTime var5 = zbq.a((double)(Integer)var0.get(var4), var1);
         DateTime var6 = zbq.a((double)(Integer)var0.get(var4 + 1), var1);
         if (com.aspose.cells.a.c.zk.b(var5.addDays((double)var3), var6)) {
            var2 = 1;
         } else if (com.aspose.cells.a.c.zk.b(var5.addYears(1), var6) && var2 == 3) {
            var2 = 2;
         }
      }

      return var2;
   }

   static int a(Object var0, boolean var1) throws Exception {
      short var2 = -10000;
      if (var0 == null) {
         return var2;
      } else {
         switch(zamo.a(var0.getClass())) {
         case 3:
         case 9:
         case 14:
            return com.aspose.cells.b.a.ze.f(var0);
         case 16:
            DateTime var3 = com.aspose.cells.b.a.ze.h(var0);
            return zbq.a(var3, var1);
         case 18:
            return zbuk.a(var0, var2);
         default:
            return zbuk.a(var0, var2);
         }
      }
   }

   private static void a(zn var0, zbo var1, com.aspose.cells.b.a.b.zp var2, int var3, boolean var4, boolean var5) {
      zif var6 = var1.c();
      float var7 = 0.0F;
      String var10 = zbq.a((zbo)var1, (Object)var1.z());
      com.aspose.cells.b.a.b.zt var11 = new com.aspose.cells.b.a.b.zt((float)var2.e(), (float)var2.f());
      boolean var12 = var1.F().j();
      com.aspose.cells.b.a.b.zs var13 = zbsp.b(var6.ap(), var10, 0, var1.F().a(), (com.aspose.cells.b.a.b.zt)var11, 1, 1);
      float var8;
      float var9;
      if (var4) {
         var9 = (float)var2.f();
         if (var12) {
            var8 = (float)var13.c();
         } else {
            var8 = (float)var13.c();
         }
      } else {
         var9 = (float)var2.e();
         if (var12) {
            var8 = (float)var13.b();
         } else if (var1.F().d() == 0) {
            var8 = (float)var13.b();
         } else if (var1.F().d() != 90 && var1.F().d() != -90) {
            var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.F().d()) * 3.141592653589793D / 180.0D));
         } else {
            var8 = (float)var13.c();
         }
      }

      int var15 = (int)var1.z();
      int var16 = (int)var1.D();
      int var17 = var1.j();
      int var14;
      if (!var1.f() && !var6.u()) {
         var14 = zbq.a(var17, var15, var16, var1.c().S());
         if (var14 == 0) {
            var14 = 1;
         }
      } else {
         var14 = zbq.a(var17, var15, var16, var1.c().S()) + 1;
      }

      int var18;
      int var19;
      if (var1.O() && var1.P()) {
         while(true) {
            if ((float)var14 * (var8 + var7) < var9) {
               var1.c(1.0D);
               var1.e(1.0D);
               var1.g(var1.j());
               var1.i(var1.j());
               return;
            }

            if (!var12 || var5) {
               break;
            }

            if (var1.F().d() != 0) {
               if (var1.F().d() == 45) {
                  var1.F().b(90);
                  var8 = (float)var13.c();
               }
               break;
            }

            var1.F().b(45);
            var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.F().d()) * 3.141592653589793D / 180.0D));
         }

         if (var12 && !var5 && var1.F().d() > 0) {
            var8 *= 2.0F;
         }

         var18 = (int)(var9 / (var8 + var7));
         var19 = var14 % var18 == 0 ? var14 / var18 : var14 / var18 + 1;
         if (var1.j() == 1) {
            if (var19 <= 2) {
               var1.c((double)var19);
               var1.e(1.0D);
               var1.g(var1.j());
               var1.i(var1.j());
            } else if (var19 > 2 && var19 <= 7) {
               var1.c(7.0D);
               var1.e(1.0D);
               var1.g(var1.j());
               var1.i(var1.j());
            } else if (var19 > 7 && var19 <= 14) {
               var1.c(14.0D);
               var1.e(7.0D);
               var1.g(var1.j());
               var1.i(var1.j());
            } else if (var19 > 14 && var19 <= 30) {
               var1.c(1.0D);
               var1.e(1.0D);
               var1.g(2);
               var1.i(2);
            } else if (var19 > 30 && var19 <= 360) {
               var1.c(var19 % 30 == 0 ? (double)(var19 / 30) : (double)(var19 / 30 + 1));
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(2);
               var1.i(2);
            } else {
               var1.c(var19 % 360 == 0 ? (double)(var19 / 360) : (double)(var19 / 360 + 1));
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(3);
               var1.i(3);
            }
         } else if (var1.j() == 2) {
            if (var19 < 12) {
               var1.c((double)var19);
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(2);
               var1.i(2);
            } else {
               var1.c(var19 % 12 == 0 ? (double)(var19 / 12) : (double)(var19 / 12 + 1));
               var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
               var1.g(3);
               var1.i(3);
            }
         } else {
            var1.c((double)var19);
            var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
            var1.g(3);
            var1.i(3);
         }
      } else if (var1.O() && !var1.P()) {
         var18 = zbuk.a((double)((float)((double)zbq.b(var1.C(), var15, var16, var1.c().S()) / var1.B())));
         if (!var1.f() && !var6.u()) {
            var14 = var18;
            if (var18 == 0) {
               var14 = 1;
            }
         } else {
            var14 = var18 + 1;
         }

         while(true) {
            if ((float)var14 * (var8 + var7) < var9) {
               var1.g(var1.C());
               var1.c(var1.B());
               return;
            }

            if (!var12 || var5) {
               break;
            }

            if (var1.F().d() != 0) {
               if (var1.F().d() == 45) {
                  var1.F().b(90);
                  var8 = (float)var13.c();
               }
               break;
            }

            var1.F().b(45);
            var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.F().d()) * 3.141592653589793D / 180.0D));
         }

         if (var12 && !var5 && var1.F().d() > 0) {
            var8 *= 2.0F;
         }

         var19 = (int)(var9 / (var8 + var7));
         int var20 = var14 % var19 == 0 ? var14 / var19 : var14 / var19 + 1;
         if (var1.j() == 1) {
            if (var20 <= 2) {
               if (var1.C() > var1.j()) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(var1.j());
                  var1.c((double)var20);
                  if (var1.x() < var1.B()) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 2 && var20 <= 7) {
               if (var1.C() > var1.j()) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(var1.j());
                  var1.c(7.0D);
                  if (var1.x() < var1.B()) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 7 && var20 <= 14) {
               if (var1.C() > var1.j()) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(var1.j());
                  var1.c(14.0D);
                  if (var1.x() < var1.B()) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 14 && var20 <= 30) {
               if (var1.C() == 3) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(2);
                  var1.c(1.0D);
                  if (var1.x() < var1.B() && var1.C() == 2) {
                     var1.c(var1.B());
                  }
               }
            } else if (var20 > 30 && var20 <= 360) {
               if (var1.C() == 3) {
                  var1.g(var1.C());
                  var1.c(var1.B());
               } else {
                  var1.g(2);
                  var1.c(var20 % 30 == 0 ? (double)(var20 / 30) : (double)(var20 / 30 + 1));
                  if (var1.x() < var1.B() && var1.C() == 2) {
                     var1.c(var1.B());
                  }
               }
            } else {
               var1.c(var20 % 360 == 0 ? (double)(var20 / 360) : (double)(var20 / 360 + 1));
               var1.g(3);
               if (var1.x() < var1.B() && var1.C() == 3) {
                  var1.c(var1.B());
               }
            }
         } else if (var1.j() == 2) {
            if (var20 < 12) {
               if (var1.C() == 2) {
                  if (var1.B() <= (double)var20) {
                     var1.c((double)var20);
                     var1.g(2);
                  } else {
                     var1.c(var1.B());
                     var1.g(2);
                  }
               } else {
                  var1.c(var1.B());
                  var1.g(3);
               }
            } else {
               var20 = var20 % 12 == 0 ? var20 / 12 : var20 / 12 + 1;
               if (var1.C() == 2) {
                  var1.c((double)var20);
                  var1.g(3);
               } else if (var1.B() <= (double)var20) {
                  var1.c((double)var20);
                  var1.g(3);
               } else {
                  var1.c(var1.B());
                  var1.g(3);
               }
            }
         } else {
            if (var1.B() <= (double)var20) {
               var1.c((double)var20);
            } else {
               var1.c(var1.B());
            }

            var1.g(3);
         }
      } else if (!var1.O() && var1.P()) {
         var1.e((int)(var1.x() / 2.0D) == 0 ? 1.0D : (double)((int)(var1.x() / 2.0D)));
         var1.i(var1.y());
         if (var12 && !var5) {
            var18 = zbuk.a((double)((float)((double)zbq.b(var1.y(), var15, var16, var1.c().S()) / var1.x())));
            if (!var1.f() && !var6.u()) {
               var14 = var18;
               if (var18 == 0) {
                  var14 = 1;
               }
            } else {
               var14 = var18 + 1;
            }

            while((float)var14 * (var8 + var7) > var9) {
               if (var1.F().d() == 0) {
                  var1.F().b(45);
                  var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.F().d()) * 3.141592653589793D / 180.0D));
               } else if (var1.F().d() == 45) {
                  var1.F().b(90);
                  break;
               }
            }
         }
      } else if (var12 && !var5) {
         var18 = zbuk.a((double)((float)((double)zbq.b(var1.y(), var15, var16, var1.c().S()) / var1.x())));
         if (!var1.f() && !var6.u()) {
            var14 = var18;
            if (var18 == 0) {
               var14 = 1;
            }
         } else {
            var14 = var18 + 1;
         }

         while((float)var14 * (var8 + var7) > var9) {
            if (var1.F().d() == 0) {
               var1.F().b(45);
               var8 = (float)((double)var13.c() / Math.sin((double)Math.abs(var1.F().d()) * 3.141592653589793D / 180.0D));
            } else if (var1.F().d() == 45) {
               var1.F().b(90);
               break;
            }
         }
      }

   }

   static ArrayList a(List var0, boolean var1) throws Exception {
      ArrayList var2 = new ArrayList();

      for(int var3 = 0; var3 < var0.size(); ++var3) {
         int var4 = a(((zfo)var0.get(var3)).a(), var1);
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
      }

      return var2;
   }

   static void a(zn var0, zbo var1, double var2, double var4, ArrayList var6, int var7, com.aspose.cells.b.a.b.zp var8, boolean var9, zbcp var10) {
      double var11 = var2;
      double var13 = var4;
      zif var15 = var1.c();
      if (var2 == var4 && var2 == 0.0D) {
         var1.d(10.0D);
         var2 = 10.0D;
         var11 = 10.0D;
         var1.f(1.0D);
      }

      boolean var16 = var1.N();
      boolean var17 = var1.M();
      double var18 = 0.0D;
      byte var20 = 1;
      boolean var21 = var10.ap();
      if (var21) {
         if (var2 == 100.0D && var1.N()) {
            var1.d(100.0D);
         }

         if (var4 >= 1.0D && var1.M()) {
            var1.f(1.0D);
         }
      }

      double var22 = 0.0D;
      double var24 = 0.0D;
      double[] var26 = new double[]{var22};
      double[] var27 = new double[]{var24};
      double[] var28 = new double[]{var4};
      double[] var29 = new double[]{var2};
      double[] var30 = new double[]{var18};
      int[] var31 = new int[]{var20};
      a(var26, var27, var28, var29, var30, var31, var1, var9);
      var22 = var26[0];
      var24 = var27[0];
      var4 = var28[0];
      var2 = var29[0];
      var18 = var30[0];
      int var34 = var31[0];
      c(var1, var34, var18, var24, var22, var6, var11, var13, var16, var17, var21);
      int var32 = b(var0, var1, var9, var10, var8);
      boolean var33 = false;
      int var35;
      if (var1.c().U()) {
         if (var9) {
            var35 = (int)var1.c().N().g();
         } else {
            var35 = (int)var1.c().N().i();
         }
      } else if (var9) {
         var35 = var8.e();
      } else {
         var35 = var8.f();
      }

      while(var1.O() && var6.size() > 3 && var32 > var35 && var35 != 0) {
         ++var18;
         c(var1, var34, var18, var24, var22, var6, var11, var13, var16, var17, var21);
         var32 = b(var0, var1, var9, var10, var8);
      }

      if (var6.size() >= 2) {
         var1.d(zbuk.f((Double)var6.get(0)));
         var1.f(zbuk.f((Double)var6.get(var6.size() - 1)));
         if (var1.O()) {
            var1.c(zbuk.f(var18));
         }

         if (var1.P()) {
            var1.e(var1.x());
         }
      }

   }

   private static void a(double[] var0, double[] var1, double[] var2, double[] var3, double[] var4, int[] var5, zbo var6, boolean var7) {
      var4[0] = 1.0D;
      double var8;
      double var10;
      if (var6.O()) {
         var8 = b(var2[0]);
         var10 = a(var3[0]);
         var1[0] = var8;
         var0[0] = var10;
         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var8 >= 0.0D && var10 >= 0.0D) {
               var6.f(zbuk.f(0.0D));
               var5[0] = 2;
               var1[0] = 0.0D;
            } else {
               var6.f(zbuk.f(var8));
               var5[0] = 2;
               var1[0] = var8;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = zbuk.e(var6.z());
            var3[0] = var0[0];
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = zbuk.e(var6.D());
            var2[0] = var1[0];
         } else {
            var5[0] = 2;
            var1[0] = zbuk.e(var6.D());
            var0[0] = zbuk.e(var6.z());
            var2[0] = zbuk.e(var6.D());
            var3[0] = zbuk.e(var6.z());
         }
      } else {
         var4[0] = zbuk.e(var6.x());
         var8 = (double)((int)var2[0]);
         var10 = (double)((int)var3[0]) + var4[0];
         var1[0] = var8;
         var0[0] = var10;
         if (var6.N() && var6.M()) {
            var5[0] = 3;
            if (var8 >= 0.0D && var10 >= 0.0D) {
               var6.f(zbuk.f(0.0D));
               var5[0] = 2;
               var1[0] = 0.0D;
            } else {
               var6.f(zbuk.f(var8));
               var5[0] = 2;
               var1[0] = var8;
            }
         } else if (!var6.N() && var6.M()) {
            var5[0] = 1;
            var0[0] = zbuk.e(var6.z());
            var3[0] = var0[0];
         } else if (var6.N() && !var6.M()) {
            var5[0] = 2;
            var1[0] = zbuk.e(var6.D());
            var2[0] = var1[0];
         } else {
            var5[0] = 2;
            var1[0] = zbuk.e(var6.D());
            var0[0] = zbuk.e(var6.z());
            var2[0] = zbuk.e(var6.D());
            var3[0] = zbuk.e(var6.z());
         }
      }

   }

   private static void c(zbo var0, int var1, double var2, double var4, double var6, ArrayList var8, double var9, double var11, boolean var13, boolean var14, boolean var15) {
      var8.clear();
      double var16;
      if (var1 == 1) {
         for(var16 = var6; var16 >= var4 || zbuk.a(var4, var16) < var2; var16 -= var2) {
            if (!var0.M() && var16 < var0.T()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.T());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }
      } else if (var1 == 2) {
         for(var16 = var4; var16 <= var6 || var16 < var6 + var2; var16 += var2) {
            if (!var0.N() && var16 > var0.S()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.S());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }

         Collections.reverse(var8);
      } else {
         for(var16 = 0.0D; var16 <= var6 || zbuk.a(var16, var6) < var2; var16 += var2) {
            if (!var0.N() && var16 > var0.S()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.S());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }

         Collections.reverse(var8);

         for(var16 = 0.0D - var2; var16 >= var4 || zbuk.a(var4, var16) < var2; var16 -= var2) {
            if (!var0.M() && var16 < var0.T()) {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var0.T());
            } else {
               com.aspose.cells.b.a.a.ze.a(var8, (Object)var16);
            }
         }
      }

   }

   private static int b(zn var0, zbo var1, boolean var2, zbcp var3, com.aspose.cells.b.a.b.zp var4) {
      if (var1.E() == 3) {
         return 0;
      } else {
         zbtj var5 = var1.F();
         zjd var6 = var3.D().b(0);
         String var7 = var6.z();
         boolean var8 = var6.A();
         boolean var9 = false;
         if (var5.h() && var6 != null) {
            var9 = true;
         }

         int var10 = 0;

         for(int var11 = 0; var11 < var1.l.size(); ++var11) {
            double var12 = zbuk.f((Double)var1.l.get(var11));
            if (var3.ap()) {
               var12 /= 100.0D;
               var7 = "0%";
            }

            String var14 = "";
            if (var9) {
               var14 = zpv.a(var1.c().al(), var12, var7, var8);
            } else {
               var14 = zbq.a((zbo)var1, (Object)var12);
            }

            com.aspose.cells.b.a.b.zs var15 = new com.aspose.cells.b.a.b.zs(var4.e(), var4.f());
            com.aspose.cells.b.a.b.zs var16 = zbsp.b(var1.c().ap(), var14, var5.d(), var5.a(), (com.aspose.cells.b.a.b.zs)var15, 1, 1);
            if (var2) {
               if (var11 != 0 && var11 != var1.l.size() - 1) {
                  var10 += var16.b();
               } else {
                  var10 += var16.b() / 2;
               }
            } else if (var11 != 0 && var11 != var1.l.size() - 1) {
               var10 += var16.c();
            } else {
               var10 += var16.c() / 2;
            }

            if (var11 != 0 && var11 != var1.l.size() - 1) {
               var10 -= 2;
            } else {
               --var10;
            }
         }

         return (int)((double)var10 + 0.5D);
      }
   }

   private static double a(double var0) {
      boolean var2 = true;
      if (var0 < 0.0D) {
         var2 = false;
      }

      var0 = Math.abs(var0);
      double var3;
      if (var2) {
         var3 = (double)zbuk.b(var0);
         if (var3 != var0) {
            ++var3;
         }

         return var3;
      } else {
         var3 = (double)zbuk.b(var0);
         return -var3;
      }
   }

   private static double b(double var0) {
      boolean var2 = true;
      if (var0 < 0.0D) {
         var2 = false;
      }

      var0 = Math.abs(var0);
      double var3;
      if (!var2) {
         var3 = (double)zbuk.b(var0);
         if (var3 != var0) {
            ++var3;
         }

         return -var3;
      } else {
         var3 = (double)zbuk.b(var0);
         return var3;
      }
   }

   private static boolean m(zif var0) {
      int var1;
      zahv var2;
      for(var1 = 0; var1 < var0.A().getCount(); ++var1) {
         var2 = var0.A().a(var1);
         if (var2.m() == 57 || var2.m() == 59 || var2.m() == 58) {
            return false;
         }
      }

      for(var1 = 0; var1 < var0.A().getCount(); ++var1) {
         var2 = var0.A().a(var1);
         if (var2.j()) {
            return true;
         }
      }

      return false;
   }

   private static void a(zafo var0, zafo var1) {
      if (!var0.q()) {
         var0.a(var1.f());
         var0.d(var1.k());
         var0.e(var1.r());
         if (!var1.r()) {
            var0.c(var1.j());
         }

         var0.g(var1.y());
         var0.i(var1.C());
         var0.c(var1.p());
         var0.i(var1.O());
         if (!var1.O()) {
            var0.c(var1.x());
         }

         var0.j(var1.P());
         if (!var1.P()) {
            var0.e(var1.B());
         }

         var0.h(var1.N());
         if (!var1.N()) {
            var0.d(var1.z());
         }

         var0.g(var1.M());
         if (!var1.M()) {
            var0.f(var1.D());
         }

      }
   }

   private static void n(zif var0) {
      int var1;
      zafr var2;
      zfo var3;
      for(var1 = 0; var1 < var0.z().d().size(); ++var1) {
         var2 = (zafr)var0.z().d().get(var1);
         var3 = new zfo((zfo)null, var2.a());
         var3.a(var2.b());
         var3.b(var2.f());
         var3.c(var2.g());
         var3.a(var2.c());
         com.aspose.cells.b.a.a.ze.a(var0.z().f(), (Object)var3);
      }

      var0.z().d().clear();

      for(var1 = 0; var1 < var0.z().c().size(); ++var1) {
         var2 = (zafr)var0.z().c().get(var1);
         var3 = new zfo((zfo)null, var2.a());
         var3.a(var2.b());
         var3.b(var2.f());
         var3.c(var2.g());
         var3.a(var2.c());
         com.aspose.cells.b.a.a.ze.a(var0.z().d(), (Object)var3);
      }

   }

   static ArrayList[] a(zafs var0) {
      ArrayList[] var1 = null;
      int var2 = c(var0);
      if (var2 > 1) {
         var1 = new ArrayList[var2 - 1];

         for(int var3 = 0; var3 < var2 - 1; ++var3) {
            var1[var3] = new ArrayList();
            a(var0, var3, 0, var1[var3]);
         }
      }

      return var1;
   }

   static ArrayList b(zafs var0) {
      ArrayList var1 = null;
      var1 = new ArrayList();
      int var2 = c(var0);
      a(var0, var2 - 1, 0, var1);
      return var1;
   }

   private static int c(zafs var0) {
      if (var0.getCount() == 0) {
         return 0;
      } else {
         zafr var1 = var0.a(0);

         int var2;
         for(var2 = 1; var1.d().getCount() > 0; var1 = var1.d().a(0)) {
            ++var2;
         }

         return var2;
      }
   }

   private static void a(zafs var0, int var1, int var2, ArrayList var3) {
      int var4;
      zafr var5;
      if (var1 == var2) {
         for(var4 = 0; var4 < var0.getCount(); ++var4) {
            var5 = var0.a(var4);
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var5);
         }
      } else {
         for(var4 = 0; var4 < var0.getCount(); ++var4) {
            var5 = var0.a(var4);
            a(var5.d(), var1, var2 + 1, var3);
         }
      }

   }
}
